Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

NFC: fdp: Detect errors from fdp_nci_create_conn()

drivers/nfc/fdp/fdp.c: In function ‘fdp_nci_patch_otp’:
drivers/nfc/fdp/fdp.c:373: warning: comparison is always false due to limited range of data type
drivers/nfc/fdp/fdp.c: In function ‘fdp_nci_patch_ram’:
drivers/nfc/fdp/fdp.c:444: warning: comparison is always false due to limited range of data type

fdp_nci_create_conn() may return a negative error code, which is
silently ignored by assigning it to a u8.

Change conn_id from u8 to int to fix this.

Fixes: a06347c04c13e380 ("NFC: Add Intel Fields Peak NFC solution driver")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>

authored by

Geert Uytterhoeven and committed by
Samuel Ortiz
fa1ce54e 6d2f70ca

+2 -2
+2 -2
drivers/nfc/fdp/fdp.c
··· 353 353 { 354 354 struct fdp_nci_info *info = nci_get_drvdata(ndev); 355 355 struct device *dev = &info->phy->i2c_dev->dev; 356 - u8 conn_id; 356 + int conn_id; 357 357 int r = 0; 358 358 359 359 if (info->otp_version >= info->otp_patch_version) ··· 424 424 { 425 425 struct fdp_nci_info *info = nci_get_drvdata(ndev); 426 426 struct device *dev = &info->phy->i2c_dev->dev; 427 - u8 conn_id; 427 + int conn_id; 428 428 int r = 0; 429 429 430 430 if (info->ram_version >= info->ram_patch_version)