UBI: block: checking for NULL instead of IS_ERR()
PATCH 1/1 UBI: block: checking for NULL instead of IS_ERR()
We recently switched from allocating ->rq using blk_init_queue() to use blk_mq_init_queue() so we need to update the error handling to check for IS_ERR() instead of NULL.
Fixes ff1f48ee3bb3 ('UBI: Block: Add blk-mq support')
Signed-off-by Dan Carpenter <[email protected]>
drivers/mtd/ubi/block.c +2 -2
@@ -409,9 +409,9 @@ int ubiblock_create(struct ubi_volume_info *vi) } dev->rq =blk_mq_init_queue (&dev->tag_set); -if (!dev->rq) { +if (IS_ERR (dev->rq)) {dev_err (disk_to_dev (gd),"blk_mq_init_queue failed" ); - ret = -ENODEV ; + ret =PTR_ERR (dev->rq); goto out_free_tags; }blk_queue_max_segments (dev->rq,UBI_MAX_SG_COUNT );
Am 05.02.2015 um 08:38 schrieb Dan Carpenter:
Quoted 13 lines
We recently switched from allocating ->rq using
blk_init_queue()to useblk_mq_init_queue()so we need to update the error handling to check forIS_ERR()instead of NULL.Fixes ff1f48ee3bb3 ('UBI: Block: Add blk-mq support')Signed-off-by Dan Carpenter <[email protected]>drivers/mtd/ubi/block.c +0
-0@@ -409,9 +409,9 @@ int ubiblock_create(struct ubi_volume_info *vi) }
drivers/mtd/ubi/block.c int ubiblock_create(struct ubi_volume_info *vi) · line 417
Quoted 10 lines
drivers/mtd/ubi/block.c +2
-2dev->rq =blk_mq_init_queue (&dev->tag_set); -if (!dev->rq) { +if (IS_ERR (dev->rq)) {dev_err (disk_to_dev (gd),"blk_mq_init_queue failed" ); - ret = -ENODEV ; + ret =PTR_ERR (dev->rq); goto out_free_tags; }blk_queue_max_segments (dev->rq,UBI_MAX_SG_COUNT );
Applied. Thanks Dan!