Skip to content

Commit

Permalink
NFC: fdp: Detect errors from fdp_nci_create_conn()
Browse files Browse the repository at this point in the history
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: a06347c ("NFC: Add Intel Fields Peak NFC solution driver")
Signed-off-by: Geert Uytterhoeven <[email protected]>
Signed-off-by: Samuel Ortiz <[email protected]>
  • Loading branch information
geertu authored and Samuel Ortiz committed Jul 4, 2016
1 parent 6d2f70c commit fa1ce54
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/nfc/fdp/fdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ static int fdp_nci_patch_otp(struct nci_dev *ndev)
{
struct fdp_nci_info *info = nci_get_drvdata(ndev);
struct device *dev = &info->phy->i2c_dev->dev;
u8 conn_id;
int conn_id;
int r = 0;

if (info->otp_version >= info->otp_patch_version)
Expand Down Expand Up @@ -424,7 +424,7 @@ static int fdp_nci_patch_ram(struct nci_dev *ndev)
{
struct fdp_nci_info *info = nci_get_drvdata(ndev);
struct device *dev = &info->phy->i2c_dev->dev;
u8 conn_id;
int conn_id;
int r = 0;

if (info->ram_version >= info->ram_patch_version)
Expand Down

0 comments on commit fa1ce54

Please sign in to comment.