]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: sr: Add memory allocation failure handling for get_capabilities()
authorEnze Li <lienze@kylinos.cn>
Wed, 27 Apr 2022 02:56:47 +0000 (10:56 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Mon, 2 May 2022 20:59:12 +0000 (16:59 -0400)
commit6bdbb0a0113d0d73c25a5152fdadd1f7c3960c4b
tree49c1fa28abcf6864f95d0c488e8a193625dd42ed
parentd4a5f3fe3517e554af6d4f7319fba0db43c82ebe
scsi: sr: Add memory allocation failure handling for get_capabilities()

The function get_capabilities() has the possibility of failing to allocate
the transfer buffer but it does not currently handle this. This may lead to
exceptions when accessing the buffer.

Add error handling when memory allocation fails.

Link: https://lore.kernel.org/r/20220427025647.298358-1-lienze@kylinos.cn
Signed-off-by: Enze Li <lienze@kylinos.cn>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/sr.c