diff options
| author | Mike Christie <[email protected]> | 2024-02-09 21:52:47 +0000 |
|---|---|---|
| committer | Martin K. Petersen <[email protected]> | 2024-02-13 01:42:00 +0000 |
| commit | 4cbec7e89a416294c46e71c967b57b9119fe0054 (patch) | |
| tree | c9e432550e65f3f98ed25c8cbb4036dd514f1866 /net/unix/garbage.c | |
| parent | scsi: ufs: core: Remove the ufshcd_release() in ufshcd_err_handling_prepare() (diff) | |
| download | kernel-4cbec7e89a416294c46e71c967b57b9119fe0054.tar.gz kernel-4cbec7e89a416294c46e71c967b57b9119fe0054.zip | |
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 'net/unix/garbage.c')
0 files changed, 0 insertions, 0 deletions
