]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
vhost: Use ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(...))
authorPei Xiao <xiaopei01@kylinos.cn>
Wed, 4 Jun 2025 06:55:48 +0000 (14:55 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Fri, 1 Aug 2025 13:11:08 +0000 (09:11 -0400)
cocci warning:
./kernel/vhost_task.c:148:9-16: WARNING: ERR_CAST can be used with tsk

Use ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(...)).

Signed-off-by: Pei Xiao <xiaopei01@kylinos.cn>
Message-Id: <1a8499a5da53e4f72cf21aca044ae4b26db8b2ad.1749020055.git.xiaopei01@kylinos.cn>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
kernel/vhost_task.c

index 2f844c279a3e01fd0fb75a09f8845f9e17dff86d..bc738fa90c1d6875344beca7813aafb03dff4762 100644 (file)
@@ -145,7 +145,7 @@ struct vhost_task *vhost_task_create(bool (*fn)(void *),
        tsk = copy_process(NULL, 0, NUMA_NO_NODE, &args);
        if (IS_ERR(tsk)) {
                kfree(vtsk);
-               return ERR_PTR(PTR_ERR(tsk));
+               return ERR_CAST(tsk);
        }
 
        vtsk->task = tsk;