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)
committerUlf Hansson <ulf.hansson@linaro.org>
Wed, 7 Dec 2022 12:29:14 +0000 (13:29 +0100)
commit4f431a047a5c8698ed4b67e2760cfbeb5fffb69d
tree95dbca1405a350eb7e95aaecb59628da9cc30c74
parent5c5301a147df77eb4479be9af74f65a334206602
memstick/ms_block: Add check for alloc_ordered_workqueue

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>
drivers/memstick/core/ms_block.c