From: Bjorn Andersson Date: Mon, 13 Feb 2017 08:44:27 +0000 (-0800) Subject: rpmsg: rpmsg_create_ept() returns NULL on error X-Git-Tag: v4.11-rc1~97^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fa04b769f2832bf1aeb2e04b8865f6b688a752fd;p=platform%2Fkernel%2Flinux-exynos.git 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 Signed-off-by: Bjorn Andersson --- diff --git a/drivers/rpmsg/rpmsg_core.c b/drivers/rpmsg/rpmsg_core.c index 3bf1418..600f5f9 100644 --- a/drivers/rpmsg/rpmsg_core.c +++ b/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); }