History

[SCSI] storvsc: NULL pointer dereference fix

If the initialization of storvsc fails, the storvsc_device_destroy() causes NULL pointer dereference. storvsc_bus_scan() scsi_scan_target() __scsi_scan_target() scsi_probe_and_add_lun(hostdata=NULL) scsi_alloc_sdev(hostdata=NULL) sdev->hostdata = hostdata now the host allocation fails __scsi_remove_device(sdev) calls sdev->host->hostt->slave_destroy() == storvsc_device_destroy(sdev) access of sdev->hostdata->request_mempool

Ales Novak committed 12 years ago

Commit b12bb601 parent b77ed251 file · +3 −0Browse files

Unified · Split

drivers/scsi/storvsc_drv.c+3−0
@@ -1419,6 +1419,9 @@ static void storvsc_device_destroy(struct scsi_device *sdevice) · 1418 unmodified lines
14191419 {
14201420 struct stor_mem_pools *memp = sdevice->hostdata;
14211421
1422+ if (!memp)
1423+ return;
1424+
14221425 mempool_destroy(memp->request_mempool);
14231426 kmem_cache_destroy(memp->request_pool);
14241427 kfree(memp);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t