All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alain Volmat <alain.volmat@st.com>
To: Wolfram Sang <wsa+renesas@sang-engineering.com>
Cc: <linux-i2c@vger.kernel.org>
Subject: Re: [PATCH 2/2] i2c: slave: add sanity check when unregistering
Date: Tue, 28 Jul 2020 14:01:33 +0200	[thread overview]
Message-ID: <20200728120133.GB8715@gnbcxd0016.gnb.st.com> (raw)
In-Reply-To: <20200725195053.14334-3-wsa+renesas@sang-engineering.com>

Hi Wolfram,

Reviewed-by: Alain Volmat <alain.volmat@st.com>

Alain

On Sat, Jul 25, 2020 at 09:50:53PM +0200, Wolfram Sang wrote:
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> ---
>  drivers/i2c/i2c-core-slave.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/i2c/i2c-core-slave.c b/drivers/i2c/i2c-core-slave.c
> index 549751347e6c..1589179d5eb9 100644
> --- a/drivers/i2c/i2c-core-slave.c
> +++ b/drivers/i2c/i2c-core-slave.c
> @@ -58,6 +58,9 @@ int i2c_slave_unregister(struct i2c_client *client)
>  {
>  	int ret;
>  
> +	if (IS_ERR_OR_NULL(client))
> +		return -EINVAL;
> +
>  	if (!client->adapter->algo->unreg_slave) {
>  		dev_err(&client->dev, "%s: not supported by adapter\n", __func__);
>  		return -EOPNOTSUPP;
> -- 
> 2.20.1
> 

  reply	other threads:[~2020-07-28 12:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-25 19:50 [PATCH 0/2] i2c: slave: improve sanity checks when un-/registering Wolfram Sang
2020-07-25 19:50 ` [PATCH 1/2] i2c: slave: improve sanity check when registering Wolfram Sang
2020-07-28 12:01   ` Alain Volmat
2020-07-28 16:40   ` Wolfram Sang
2020-07-25 19:50 ` [PATCH 2/2] i2c: slave: add sanity check when unregistering Wolfram Sang
2020-07-28 12:01   ` Alain Volmat [this message]
2020-07-28 16:40   ` Wolfram Sang

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=20200728120133.GB8715@gnbcxd0016.gnb.st.com \
    --to=alain.volmat@st.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=wsa+renesas@sang-engineering.com \
    /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.