aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/nfc/nfcmrvl/fw_dnld.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2017-04-21 15:29:40 -0400
committerDavid S. Miller <davem@davemloft.net>2017-04-21 15:29:40 -0400
commit69e3948aaa559670da2662ad9d5cbc782bfc6885 (patch)
tree9cc3ef9f538b813d53a31056a93f8e56401569f7 /drivers/nfc/nfcmrvl/fw_dnld.c
parentbonding: fix wq initialization for links created via netlink (diff)
parentnfc: fix get_unaligned_...() misuses (diff)
downloadlinux-dev-69e3948aaa559670da2662ad9d5cbc782bfc6885.tar.xz
linux-dev-69e3948aaa559670da2662ad9d5cbc782bfc6885.zip
Merge tag 'nfc-next-4.12-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/nfc-next
Samuel Ortiz says: ==================== NFC 4.12 pull request This is the NFC pull request for 4.12. We have: - Improvements for the pn533 command queue handling and device registration order. - Removal of platform data for the pn544 and st21nfca drivers. - Additional device tree options to support more trf7970a hardware options. - Support for Sony's RC-S380P through the port100 driver. - Removal of the obsolte nfcwilink driver. - Headers inclusion cleanups (miscdevice.h, unaligned.h) for many drivers. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/nfc/nfcmrvl/fw_dnld.c')
-rw-r--r--drivers/nfc/nfcmrvl/fw_dnld.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/nfc/nfcmrvl/fw_dnld.c b/drivers/nfc/nfcmrvl/fw_dnld.c
index f8dcdf4b24f6..c38bdd6a5a82 100644
--- a/drivers/nfc/nfcmrvl/fw_dnld.c
+++ b/drivers/nfc/nfcmrvl/fw_dnld.c
@@ -17,7 +17,7 @@
*/
#include <linux/module.h>
-#include <linux/unaligned/access_ok.h>
+#include <asm/unaligned.h>
#include <linux/firmware.h>
#include <linux/nfc.h>
#include <net/nfc/nci.h>
@@ -281,12 +281,11 @@ static int process_state_fw_dnld(struct nfcmrvl_private *priv,
return -EINVAL;
}
skb_pull(skb, 1);
- memcpy(&len, skb->data, 2);
+ len = get_unaligned_le16(skb->data);
skb_pull(skb, 2);
+ comp_len = get_unaligned_le16(skb->data);
memcpy(&comp_len, skb->data, 2);
skb_pull(skb, 2);
- len = get_unaligned_le16(&len);
- comp_len = get_unaligned_le16(&comp_len);
if (((~len) & 0xFFFF) != comp_len) {
nfc_err(priv->dev, "bad len complement: %x %x %x",
len, comp_len, (~len & 0xFFFF));