Skip to contentSkip to conversation

scsi: ufs: fix: NULL pointer dereference

PATCH In review Abaci Team 2 participants 2 messages Jan 27, 2021 SCSI

lore
Share & tools
lore

Abaci Team

author
#0 lore raw

PATCH 1/1 scsi: ufs: fix: NULL pointer dereference

Fix below warnings reported by coccicheck:
./drivers/scsi/ufs/ufshcd.c:8990:11-17: ERROR: hba is NULL but dereferenced.

---
 drivers/scsi/ufs/ufshcd.c | 1 -
 1 file changed, 1 deletion(-)
drivers/scsi/ufs/ufshcd.c +0 -1
index fb32d12..9319251 100644
@@ -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;
 	}
 
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 8 lines

Fix below warnings reported by coccicheck:
./drivers/scsi/ufs/ufshcd.c:8990:11-17: ERROR: hba is NULL but dereferenced.

This was already fix in commit fb7afe24ba1b (scsi: ufs: Fix a possible NULL pointer issue)

Quoted 18 lines
---
 drivers/scsi/ufs/ufshcd.c | 1 -
 1 file changed, 1 deletion(-)
drivers/scsi/ufs/ufshcd.c +0 -2
index fb32d12..9319251 100644
@@ -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