diff options
author | Mike Christie <[email protected]> | 2024-02-09 15:52:47 -0600 |
---|---|---|
committer | Martin K. Petersen <[email protected]> | 2024-02-12 20:42:00 -0500 |
commit | 4cbec7e89a416294c46e71c967b57b9119fe0054 (patch) | |
tree | c9e432550e65f3f98ed25c8cbb4036dd514f1866 /lib/test_fortify/write_overflow-strncpy-src.c | |
parent | 17e94b2585417e04dabc2f13bc03b4665ae687f3 (diff) |
scsi: target: Fix unmap setup during configuration
This issue was found and also debugged by Carl Lei <[email protected]>.
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 <[email protected]>
Signed-off-by: Mike Christie <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Maurizio Lombardi <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
Diffstat (limited to 'lib/test_fortify/write_overflow-strncpy-src.c')
0 files changed, 0 insertions, 0 deletions