diff mbox series

scsi: ufs: fix: NULL pointer dereference

Message ID 1611737384-49321-1-git-send-email-abaci-bugfix@linux.alibaba.com (mailing list archive)
State Not Applicable
Headers show
Series scsi: ufs: fix: NULL pointer dereference | expand

Commit Message

Abaci Team Jan. 27, 2021, 8:49 a.m. UTC
Fix below warnings reported by coccicheck:
./drivers/scsi/ufs/ufshcd.c:8990:11-17: ERROR: hba is NULL but
dereferenced.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Suggested-by: Yang Li <oswb@linux.alibaba.com>
Signed-off-by: Abaci Team <abaci-bugfix@linux.alibaba.com>
---
 drivers/scsi/ufs/ufshcd.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Avri Altman Jan. 27, 2021, 8:59 a.m. UTC | #1
> 
> Fix below warnings reported by coccicheck:
> ./drivers/scsi/ufs/ufshcd.c:8990:11-17: ERROR: hba is NULL but
> dereferenced.
> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Suggested-by: Yang Li <oswb@linux.alibaba.com>
> Signed-off-by: Abaci Team <abaci-bugfix@linux.alibaba.com>
This was already fix in commit fb7afe24ba1b (scsi: ufs: Fix a possible NULL pointer issue)

> ---
>  drivers/scsi/ufs/ufshcd.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
> index fb32d12..9319251 100644
> --- a/drivers/scsi/ufs/ufshcd.c
> +++ b/drivers/scsi/ufs/ufshcd.c
> @@ -8990,7 +8990,6 @@ int ufshcd_system_resume(struct ufs_hba *hba)
>         ktime_t start = ktime_get();
> 
>         if (!hba) {
> -               up(&hba->eh_sem);
>                 return -EINVAL;
>         }
> 
> --
> 1.8.3.1
diff mbox series

Patch

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index fb32d12..9319251 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -8990,7 +8990,6 @@  int ufshcd_system_resume(struct ufs_hba *hba)
 	ktime_t start = ktime_get();
 
 	if (!hba) {
-		up(&hba->eh_sem);
 		return -EINVAL;
 	}