"max_amsdu_len" isn't set if kstrtouint() fails.
Signed-off-by: Dan Carpenter <[email protected]>
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
index 362a546..cb8db23 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
@@ -1020,6 +1020,8 @@ static ssize_t iwl_dbgfs_max_amsdu_len_write(struct iwl_mvm *mvm,
int ret;
ret = kstrtouint(buf, 0, &max_amsdu_len);
+ if (ret)
+ return ret;
if (max_amsdu_len > IEEE80211_MAX_MPDU_LEN_VHT_11454)
return -EINVAL;
T24gV2VkLCAyMDE2LTA1LTA0IGF0IDA5OjE5ICswMzAwLCBEYW4gQ2FycGVudGVyIHdyb3RlOg0K
PiAibWF4X2Ftc2R1X2xlbiIgaXNuJ3Qgc2V0IGlmIGtzdHJ0b3VpbnQoKSBmYWlscy4NCj4gDQo+
IFNpZ25lZC1vZmYtYnk6IERhbiBDYXJwZW50ZXIgPGRhbi5jYXJwZW50ZXJAb3JhY2xlLmNvbT4N
Cg0KSSdtIGFsc28gcHVzaGluZyB0aGlzIG9uZSB2aWEgb3VyIGludGVybmFsIHRyZWUuIMKgVGhh
bmtzIQ0KDQotLQ0KTHVjYS4=