提交 a24e7917 编写于 作者: W Wei Yongjun 提交者: Nicholas Bellinger

tcmu: fix error return code in tcmu_configure_device()

Fix to return error code -ENOMEM from the kzalloc() error handling
case instead of 0, as done elsewhere in this function.

Fixes: 80eb8761 ("tcmu: allow max block and global max blocks to be settable")
Signed-off-by: NWei Yongjun <weiyongjun1@huawei.com>
Acked-by: NMike Christie <mchristi@redhat.com>
Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
上级 88cf1073
......@@ -1675,8 +1675,10 @@ static int tcmu_configure_device(struct se_device *dev)
udev->data_bitmap = kzalloc(BITS_TO_LONGS(udev->max_blocks) *
sizeof(unsigned long), GFP_KERNEL);
if (!udev->data_bitmap)
if (!udev->data_bitmap) {
ret = -ENOMEM;
goto err_bitmap_alloc;
}
udev->mb_addr = vzalloc(CMDR_SIZE);
if (!udev->mb_addr) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册