From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Ohad Ben-Cohen <ohad@wizery.com>,
Paul Cercueil <paul@crapouillou.net>,
linux-remoteproc@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] remoteproc: Fix an error code in devm_rproc_alloc()
Date: Wed, 20 May 2020 19:13:26 +0000 [thread overview]
Message-ID: <20200520191326.GH408178@builder.lan> (raw)
In-Reply-To: <20200520120705.GH172354@mwanda>
On Wed 20 May 05:07 PDT 2020, Dan Carpenter wrote:
> The comments say that this function should return NULL on error and the
> caller expects NULL returns as well so I have modified the code to match.
> Returning an ERR_PTR(-ENOMEM) would lead to an OOps.
>
> Fixes: 305ac5a766b1 ("remoteproc: Add device-managed variants of rproc_alloc/rproc_add")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by and applied
Thanks,
Bjorn
> ---
> drivers/remoteproc/remoteproc_core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
> index 0cc015fabf78..9f04c30c4aaf 100644
> --- a/drivers/remoteproc/remoteproc_core.c
> +++ b/drivers/remoteproc/remoteproc_core.c
> @@ -2297,7 +2297,7 @@ struct rproc *devm_rproc_alloc(struct device *dev, const char *name,
>
> ptr = devres_alloc(devm_rproc_free, sizeof(*ptr), GFP_KERNEL);
> if (!ptr)
> - return ERR_PTR(-ENOMEM);
> + return NULL;
>
> rproc = rproc_alloc(dev, name, ops, firmware, len);
> if (rproc) {
> --
> 2.26.2
>
WARNING: multiple messages have this Message-ID (diff)
From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Ohad Ben-Cohen <ohad@wizery.com>,
Paul Cercueil <paul@crapouillou.net>,
linux-remoteproc@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] remoteproc: Fix an error code in devm_rproc_alloc()
Date: Wed, 20 May 2020 12:13:26 -0700 [thread overview]
Message-ID: <20200520191326.GH408178@builder.lan> (raw)
In-Reply-To: <20200520120705.GH172354@mwanda>
On Wed 20 May 05:07 PDT 2020, Dan Carpenter wrote:
> The comments say that this function should return NULL on error and the
> caller expects NULL returns as well so I have modified the code to match.
> Returning an ERR_PTR(-ENOMEM) would lead to an OOps.
>
> Fixes: 305ac5a766b1 ("remoteproc: Add device-managed variants of rproc_alloc/rproc_add")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by and applied
Thanks,
Bjorn
> ---
> drivers/remoteproc/remoteproc_core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
> index 0cc015fabf78..9f04c30c4aaf 100644
> --- a/drivers/remoteproc/remoteproc_core.c
> +++ b/drivers/remoteproc/remoteproc_core.c
> @@ -2297,7 +2297,7 @@ struct rproc *devm_rproc_alloc(struct device *dev, const char *name,
>
> ptr = devres_alloc(devm_rproc_free, sizeof(*ptr), GFP_KERNEL);
> if (!ptr)
> - return ERR_PTR(-ENOMEM);
> + return NULL;
>
> rproc = rproc_alloc(dev, name, ops, firmware, len);
> if (rproc) {
> --
> 2.26.2
>
next prev parent reply other threads:[~2020-05-20 19:13 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-20 12:07 [PATCH] remoteproc: Fix an error code in devm_rproc_alloc() Dan Carpenter
2020-05-20 12:07 ` Dan Carpenter
2020-05-20 14:47 ` Paul Cercueil
2020-05-20 14:47 ` Paul Cercueil
2020-05-20 19:13 ` Bjorn Andersson [this message]
2020-05-20 19:13 ` Bjorn Andersson
2020-05-20 20:00 ` patchwork-bot+linux-remoteproc
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200520191326.GH408178@builder.lan \
--to=bjorn.andersson@linaro.org \
--cc=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-remoteproc@vger.kernel.org \
--cc=ohad@wizery.com \
--cc=paul@crapouillou.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.