scsi: core: Fixup calling convention for scsi_mode_sense()
mainline inclusion from mainline-v5.14-rc1 commit 8793613d category: bugfix bugzilla: 189811, https://gitee.com/src-openeuler/kernel/issues/I9FNFK CVE: CVE-2021-47182 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=8793613de913e03e7c884f4cc56e350bc716431e -------------------------------- The description for scsi_mode_sense() claims to return the number of valid bytes on success, which is not what the code does. Additionally there is no gain in returning the SCSI status, as everything the callers do is to check against scsi_result_is_good(), which is what scsi_mode_sense() does already. So change the calling convention to return a standard error code on failure, and 0 on success, and adapt the description and all callers. Link: https://lore.kernel.org/r/20210427083046.31620-4-hare@suse.de Reviewed-by:Bart Van Assche <bvanassche@acm.org> Signed-off-by:
Hannes Reinecke <hare@suse.de> Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com> Conflict: drivers/scsi/sd.c Signed-off-by:
Li Nan <linan122@huawei.com>
Loading
Please sign in to comment