projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
291c254
)
scsi: libcxgbi: fix NULL pointer dereference in cxgbi_device_destroy()
author
Varun Prakash
<varun@chelsio.com>
Wed, 18 Dec 2019 13:45:31 +0000
(19:15 +0530)
committer
Martin K. Petersen
<martin.petersen@oracle.com>
Thu, 19 Dec 2019 23:48:26 +0000
(18:48 -0500)
If cxgb4i_ddp_init() fails then cdev->cdev2ppm will be NULL, so add a check
for NULL pointer before dereferencing it.
Link:
https://lore.kernel.org/r/1576676731-3068-1-git-send-email-varun@chelsio.com
Signed-off-by: Varun Prakash <varun@chelsio.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/cxgbi/libcxgbi.c
patch
|
blob
|
history
diff --git
a/drivers/scsi/cxgbi/libcxgbi.c
b/drivers/scsi/cxgbi/libcxgbi.c
index 0d044c1659609e6b39abfdb2fb9958428317f414..dc9320f37ebfbd139008fbcdb7d4f8ebd5e6a6e6 100644
(file)
--- a/
drivers/scsi/cxgbi/libcxgbi.c
+++ b/
drivers/scsi/cxgbi/libcxgbi.c
@@
-121,7
+121,8
@@
static inline void cxgbi_device_destroy(struct cxgbi_device *cdev)
"cdev 0x%p, p# %u.\n", cdev, cdev->nports);
cxgbi_hbas_remove(cdev);
cxgbi_device_portmap_cleanup(cdev);
- cxgbi_ppm_release(cdev->cdev2ppm(cdev));
+ if (cdev->cdev2ppm)
+ cxgbi_ppm_release(cdev->cdev2ppm(cdev));
if (cdev->pmap.max_connect)
cxgbi_free_big_mem(cdev->pmap.port_csk);
kfree(cdev);