iwlwifi: mvm: catch underflow error earlier
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 21 Aug 2015 08:48:21 +0000 (11:48 +0300)
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Sun, 23 Aug 2015 06:35:04 +0000 (09:35 +0300)
My static checker complains that we don't check for underflows in
iwl_dbgfs_fw_dbg_conf_write().  This is harmless because we have a
sanity check in iwl_mvm_start_fw_dbg_conf(), but we may as well make
this unsigned and silence the underflow warning.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
drivers/net/wireless/iwlwifi/mvm/debugfs.c

index ca4a1f8..7d69a55 100644 (file)
@@ -949,9 +949,10 @@ static ssize_t iwl_dbgfs_fw_dbg_conf_write(struct iwl_mvm *mvm,
                                           char *buf, size_t count,
                                           loff_t *ppos)
 {
-       int ret, conf_id;
+       unsigned int conf_id;
+       int ret;
 
-       ret = kstrtoint(buf, 0, &conf_id);
+       ret = kstrtouint(buf, 0, &conf_id);
        if (ret)
                return ret;