Commit fa1ce54e authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Samuel Ortiz

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: a06347c0 ("NFC: Add Intel Fields Peak NFC solution driver")
Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent 6d2f70ca
...@@ -353,7 +353,7 @@ static int fdp_nci_patch_otp(struct nci_dev *ndev) ...@@ -353,7 +353,7 @@ static int fdp_nci_patch_otp(struct nci_dev *ndev)
{ {
struct fdp_nci_info *info = nci_get_drvdata(ndev); struct fdp_nci_info *info = nci_get_drvdata(ndev);
struct device *dev = &info->phy->i2c_dev->dev; struct device *dev = &info->phy->i2c_dev->dev;
u8 conn_id; int conn_id;
int r = 0; int r = 0;
if (info->otp_version >= info->otp_patch_version) if (info->otp_version >= info->otp_patch_version)
...@@ -424,7 +424,7 @@ static int fdp_nci_patch_ram(struct nci_dev *ndev) ...@@ -424,7 +424,7 @@ static int fdp_nci_patch_ram(struct nci_dev *ndev)
{ {
struct fdp_nci_info *info = nci_get_drvdata(ndev); struct fdp_nci_info *info = nci_get_drvdata(ndev);
struct device *dev = &info->phy->i2c_dev->dev; struct device *dev = &info->phy->i2c_dev->dev;
u8 conn_id; int conn_id;
int r = 0; int r = 0;
if (info->ram_version >= info->ram_patch_version) if (info->ram_version >= info->ram_patch_version)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment