Skip to content

Commit 3ddeabd

Browse files
rafaelmsoaresmartinkpetersen
authored andcommitted
scsi: qla2xxx: Fix serialization of DCBX TLV data request
Commit b6faaaf ("scsi: qla2xxx: Serialize mailbox request") serialized mailbox requests from userspace using the 'optrom' mutex. However, in the case of DCBX TLV data, if the memory for it is already allocated, then the mailbox request ends up not being serialized because it is done without holding the 'optrom' mutex. Link: https://lore.kernel.org/r/[email protected] Fixes: b6faaaf ("scsi: qla2xxx: Serialize mailbox request") Reviewed-by: Himanshu Madhani <[email protected]> Signed-off-by: Rafael Mendonca <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 07e4336 commit 3ddeabd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/scsi/qla2xxx/qla_attr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -951,9 +951,9 @@ qla2x00_sysfs_read_dcbx_tlv(struct file *filp, struct kobject *kobj,
951951
if (!capable(CAP_SYS_ADMIN) || off != 0 || count > DCBX_TLV_DATA_SIZE)
952952
return 0;
953953

954+
mutex_lock(&vha->hw->optrom_mutex);
954955
if (ha->dcbx_tlv)
955956
goto do_read;
956-
mutex_lock(&vha->hw->optrom_mutex);
957957
if (qla2x00_chip_is_down(vha)) {
958958
mutex_unlock(&vha->hw->optrom_mutex);
959959
return 0;

0 commit comments

Comments
 (0)