From: Dan Carpenter <dan.carpenter@linaro.org>
To: Joy Chakraborty <joychakr@google.com>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Rob Herring <robh@kernel.org>,
Nicolas Saenz Julienne <nsaenz@kernel.org>,
linux-kernel@vger.kernel.org, manugautam@google.com,
stable@vger.kernel.org
Subject: Re: [PATCH v3] nvmem: rmem: Fix return value of rmem_read()
Date: Fri, 7 Jun 2024 19:47:06 +0300 [thread overview]
Message-ID: <b4eddc66-9fe7-4f52-936a-7cfd8c2b424c@moroto.mountain> (raw)
In-Reply-To: <20240607160510.3968596-1-joychakr@google.com>
On Fri, Jun 07, 2024 at 04:05:10PM +0000, Joy Chakraborty wrote:
> reg_read() callback registered with nvmem core expects 0 on success and
> a negative value on error but rmem_read() returns the number of bytes
> read which is treated as an error at the nvmem core.
>
> This does not break when rmem is accessed using sysfs via
> bin_attr_nvmem_read()/write() but causes an error when accessed from
> places like nvmem_access_with_keepouts(), etc.
>
> Change to return 0 on success and error in case
> memory_read_from_buffer() returns an error or -EIO if bytes read do not
> match what was requested.
>
> Fixes: 5a3fa75a4d9c ("nvmem: Add driver to expose reserved memory as nvmem")
> Cc: stable@vger.kernel.org
> Signed-off-by: Joy Chakraborty <joychakr@google.com>
> ---
Thanks!
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
You mentioned some other functions that had similar bugs. Could you
fix those as well.
regards,
dan carpenter
next prev parent reply other threads:[~2024-06-07 16:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-07 16:05 Joy Chakraborty
2024-06-07 16:47 ` Dan Carpenter [this message]
2024-06-11 9:30 ` Srinivas Kandagatla
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=b4eddc66-9fe7-4f52-936a-7cfd8c2b424c@moroto.mountain \
--to=dan.carpenter@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=joychakr@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=manugautam@google.com \
--cc=nsaenz@kernel.org \
--cc=robh@kernel.org \
--cc=srinivas.kandagatla@linaro.org \
--cc=stable@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®