memstick/ms_block: Add check for alloc_ordered_workqueue
authorJiasheng Jiang <jiasheng@iscas.ac.cn>
Sat, 26 Nov 2022 01:25:58 +0000 (09:25 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:14:17 +0000 (13:14 +0100)
commit7fecca429e6eb5b6f4a8e8d3f8c75212aedfb0d7
treeb743efd8bb41c59b1b283287803918b336db7671
parentb77ced3fce5c54495000a4308b0bc3e6e20f6555
memstick/ms_block: Add check for alloc_ordered_workqueue

[ Upstream commit 4f431a047a5c8698ed4b67e2760cfbeb5fffb69d ]

As the alloc_ordered_workqueue may return NULL pointer, it should be better
to add check for the return value. Moreover, the msb->io_queue should be
freed if error occurs later.

Fixes: 0ab30494bc4f ("memstick: add support for legacy memorysticks")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Link: https://lore.kernel.org/r/20221126012558.34374-1-jiasheng@iscas.ac.cn
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/memstick/core/ms_block.c