From 7dcb9c92fe4b6449edae10fbec8c80f15506d5ca Mon Sep 17 00:00:00 2001 From: Rafal Stefanowski Date: Wed, 5 Feb 2025 17:20:07 +0100 Subject: [PATCH] Fix checking for NULL instead of error pointer Signed-off-by: Rafal Stefanowski --- configure.d/2_alloc_disk.conf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/configure.d/2_alloc_disk.conf b/configure.d/2_alloc_disk.conf index 0686357..719f14f 100644 --- a/configure.d/2_alloc_disk.conf +++ b/configure.d/2_alloc_disk.conf @@ -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;