diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c
index 8ee9e94e25fe54df63b47a1b368fd3ba574536b9..dc06b6914b5e76ea20a1a58e266d1d341bf79b22 100644
--- a/drivers/infiniband/core/uverbs_cmd.c
+++ b/drivers/infiniband/core/uverbs_cmd.c
@@ -1050,11 +1050,7 @@ static int ib_uverbs_create_cq(struct uverbs_attr_bundle *attrs,
 			offsetof(typeof(cmd_ex), comp_channel) +
 				sizeof(cmd.comp_channel),
 			ib_uverbs_create_cq_cb, NULL);
-
-	if (IS_ERR(obj))
-		return PTR_ERR(obj);
-
-	return 0;
+	return PTR_ERR_OR_ZERO(obj);
 }
 
 static int ib_uverbs_ex_create_cq_cb(struct uverbs_attr_bundle *attrs,