]> git.ipfire.org Git - people/ms/linux.git/commit
SCSI: storvsc: NULL pointer dereference fix
authorAles Novak <alnovak@suse.cz>
Thu, 27 Feb 2014 10:03:30 +0000 (11:03 +0100)
committerJiri Slaby <jslaby@suse.cz>
Mon, 24 Mar 2014 08:45:04 +0000 (09:45 +0100)
commitf27a0d9cecbc0afd12f72f79ab652feb685202b0
treecb83aab3f991c27979fa3eb323fee5e9c7168a85
parent108f920124944eaf21a780f588a5dc2041192244
SCSI: storvsc: NULL pointer dereference fix

commit b12bb60d6c350b348a4e1460cd68f97ccae9822e upstream.

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

Signed-off-by: Ales Novak <alnovak@suse.cz>
Signed-off-by: Thomas Abraham <tabraham@suse.com>
Reviewed-by: Jiri Kosina <jkosina@suse.cz>
Acked-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
drivers/scsi/storvsc_drv.c