Browse Source

rpmsg: rpmsg_create_ept() returns NULL on error

The parameter validation incorrectly returned an ERR_PTR(), which is not
handled by the callers to rpmsg_create_ept(), per the definition NULL
should be returned.

Fixes: 93e9324431c9 ("rpmsg: Handle invalid parameters in public API")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Bjorn Andersson 8 năm trước cách đây
mục cha
commit
fa04b769f2
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      drivers/rpmsg/rpmsg_core.c

+ 1 - 1
drivers/rpmsg/rpmsg_core.c

@@ -72,7 +72,7 @@ struct rpmsg_endpoint *rpmsg_create_ept(struct rpmsg_device *rpdev,
 					struct rpmsg_channel_info chinfo)
 {
 	if (WARN_ON(!rpdev))
-		return ERR_PTR(-EINVAL);
+		return NULL;
 
 	return rpdev->ops->create_ept(rpdev, cb, priv, chinfo);
 }