Fix checking for NULL instead of error pointer

Signed-off-by: Rafal Stefanowski <rafal.stefanowski@huawei.com>
This commit is contained in:
Rafal Stefanowski 2025-02-05 17:20:07 +01:00
parent 52d0ff4c7b
commit 7dcb9c92fe

View File

@ -33,8 +33,8 @@ apply() {
struct blk_mq_tag_set *tag_set)
{
*gd = blk_mq_alloc_disk(tag_set, NULL, NULL);
if (!(*gd))
return -ENOMEM;
if (IS_ERR(*gd))
return PTR_ERR(*gd);
*queue = (*gd)->queue;
@ -53,8 +53,8 @@ apply() {
struct blk_mq_tag_set *tag_set)
{
*gd = blk_mq_alloc_disk(tag_set, NULL);
if (!(*gd))
return -ENOMEM;
if (IS_ERR(*gd))
return PTR_ERR(*gd);
*queue = (*gd)->queue;