diff options
author | Matthew R. Ochs <mrochs@linux.vnet.ibm.com> | 2017-06-28 12:14:21 -0500 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2017-07-01 17:01:03 -0400 |
commit | acfeb23b29894deaee65d63c55bea09183f6b538 (patch) | |
tree | 16c01d8d93cc04da716bd2330839553b7b4ed99c /drivers/scsi/mac53c94.c | |
parent | f9279c968c257ee39b0d7bd2571a4d231a67bcc1 (diff) | |
download | linux-acfeb23b29894deaee65d63c55bea09183f6b538.tar.bz2 |
scsi: cxlflash: Avoid double free of character device
The device_unregister() service used when cleaning up the character
device is already responsible for the internal state associated with the
device upon successful creation. As the cxlflash driver does not obtain
a second reference to the character device, the explicit call to
put_device() is not required and can lead to an inconsistent sysfs among
other issues as the reference is no longer valid after the first
put_device() is performed.
Remove the unnecessary put_device() to remedy this issue.
Fixes: a834a36b57d9 ("scsi: cxlflash: Create character device to provide host management interface")
Signed-off-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/mac53c94.c')
0 files changed, 0 insertions, 0 deletions