|
@@ -308,18 +308,18 @@ static ssize_t iwl_dbgfs_nvm_read(struct file *file,
|
|
return -ENODATA;
|
|
return -ENODATA;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ ptr = priv->eeprom;
|
|
|
|
+ if (!ptr) {
|
|
|
|
+ IWL_ERR(priv, "Invalid EEPROM/OTP memory\n");
|
|
|
|
+ return -ENOMEM;
|
|
|
|
+ }
|
|
|
|
+
|
|
/* 4 characters for byte 0xYY */
|
|
/* 4 characters for byte 0xYY */
|
|
buf = kzalloc(buf_size, GFP_KERNEL);
|
|
buf = kzalloc(buf_size, GFP_KERNEL);
|
|
if (!buf) {
|
|
if (!buf) {
|
|
IWL_ERR(priv, "Can not allocate Buffer\n");
|
|
IWL_ERR(priv, "Can not allocate Buffer\n");
|
|
return -ENOMEM;
|
|
return -ENOMEM;
|
|
}
|
|
}
|
|
-
|
|
|
|
- ptr = priv->eeprom;
|
|
|
|
- if (!ptr) {
|
|
|
|
- IWL_ERR(priv, "Invalid EEPROM/OTP memory\n");
|
|
|
|
- return -ENOMEM;
|
|
|
|
- }
|
|
|
|
pos += scnprintf(buf + pos, buf_size - pos, "NVM Type: %s\n",
|
|
pos += scnprintf(buf + pos, buf_size - pos, "NVM Type: %s\n",
|
|
(priv->nvm_device_type == NVM_DEVICE_TYPE_OTP)
|
|
(priv->nvm_device_type == NVM_DEVICE_TYPE_OTP)
|
|
? "OTP" : "EEPROM");
|
|
? "OTP" : "EEPROM");
|