diff options
author | Mike Christie <michael.christie@oracle.com> | 2024-02-09 15:52:47 -0600 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2024-02-12 20:42:00 -0500 |
commit | 4cbec7e89a416294c46e71c967b57b9119fe0054 (patch) | |
tree | c9e432550e65f3f98ed25c8cbb4036dd514f1866 /drivers/usb/cdns3/cdns3-starfive.c | |
parent | 17e94b2585417e04dabc2f13bc03b4665ae687f3 (diff) |
scsi: target: Fix unmap setup during configuration
This issue was found and also debugged by Carl Lei <me@xecycle.info>.
If the device is not enabled, iblock/file will have not setup their
se_device to bdev/file mappings. If a user tries to config the unmap
settings at this time, we will then crash trying to access a NULL pointer
where the bdev/file should be.
This patch adds a check to make sure the device is configured before
we try to call the configure_unmap callout.
Fixes: 34bd1dcacf0d ("scsi: target: Detect UNMAP support post configuration")
Reported-by: Carl Lei <me@xecycle.info>
Signed-off-by: Mike Christie <michael.christie@oracle.com>
Link: https://lore.kernel.org/r/20240209215247.5213-1-michael.christie@oracle.com
Reviewed-by: Maurizio Lombardi <mlombard@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/usb/cdns3/cdns3-starfive.c')
0 files changed, 0 insertions, 0 deletions