mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
firmware_class: Correct a null check in firmware_direct_read
Don't use the fw pointer before performing the null check on it. Change-Id: I303f71681647e2acb0b7e340b8f8580436cfb19d Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
This commit is contained in:
parent
c8cd2ed442
commit
4e2880ee5d
1 changed files with 4 additions and 1 deletions
|
@ -721,6 +721,9 @@ static ssize_t firmware_direct_read(struct file *filp, struct kobject *kobj,
|
|||
struct firmware *fw;
|
||||
ssize_t ret_count;
|
||||
|
||||
if (!fw_priv->fw)
|
||||
return -ENODEV;
|
||||
|
||||
mutex_lock(&fw_lock);
|
||||
fw = fw_priv->fw;
|
||||
|
||||
|
@ -731,7 +734,7 @@ static ssize_t firmware_direct_read(struct file *filp, struct kobject *kobj,
|
|||
if (count > fw->size - offset)
|
||||
count = fw->size - offset;
|
||||
|
||||
if (!fw || test_bit(FW_STATUS_DONE, &fw_priv->buf->status)) {
|
||||
if (test_bit(FW_STATUS_DONE, &fw_priv->buf->status)) {
|
||||
ret_count = -ENODEV;
|
||||
goto out;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue