linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Biju Das <biju.das@bp.renesas.com>
Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	"kbuild@01.org" <kbuild@01.org>,
	"kbuild-all@01.org" <kbuild-all@01.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [kbuild] [usb:usb-next 32/38] drivers/usb/typec/hd3ss3220.c:182 hd3ss3220_probe() warn: passing zero to 'PTR_ERR'
Date: Mon, 7 Oct 2019 17:33:10 +0300	[thread overview]
Message-ID: <20191007143310.GK21515@kadam> (raw)
In-Reply-To: <OSBPR01MB2103FEAFF4E52D3E881179C7B89B0@OSBPR01MB2103.jpnprd01.prod.outlook.com>

On Mon, Oct 07, 2019 at 02:19:05PM +0000, Biju Das wrote:
> OK.  Are you ok with the below changes?
> 

It will generate a compile warning so no...  :P

> @@ -178,7 +178,7 @@ static int hd3ss3220_probe(struct i2c_client *client,
>  
>         hd3ss3220->role_sw = fwnode_usb_role_switch_get(connector);
>         fwnode_handle_put(connector);
> -       if (IS_ERR_OR_NULL(hd3ss3220->role_sw))
> +       if (IS_ERR(hd3ss3220->role_sw))
>                 return PTR_ERR(hd3ss3220->role_sw);
>  
>         hd3ss3220->typec_cap.prefer_role = TYPEC_NO_PREFERRED_ROLE;
> @@ -188,20 +188,22 @@ static int hd3ss3220_probe(struct i2c_client *client,
>  
>         hd3ss3220->port = typec_register_port(&client->dev,
>                                               &hd3ss3220->typec_cap);
> -       if (IS_ERR(hd3ss3220->port))
> +       if (IS_ERR(hd3ss3220->port)) {
> +               usb_role_switch_put(hd3ss3220->role_sw);
>                 return PTR_ERR(hd3ss3220->port);

		ret = PTR_ERR(hd3ss3220->port);
		goto err_put_role

> +       }

Otherwise I think it's the right thing.  Thanks!

regards,
dan carpenter


  reply	other threads:[~2019-10-07 14:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-07 11:29 [kbuild] [usb:usb-next 32/38] drivers/usb/typec/hd3ss3220.c:182 hd3ss3220_probe() warn: passing zero to 'PTR_ERR' Dan Carpenter
2019-10-07 12:36 ` Biju Das
2019-10-07 13:17   ` Dan Carpenter
2019-10-07 14:19     ` Biju Das
2019-10-07 14:33       ` Dan Carpenter [this message]
2019-10-07 14:51         ` Biju Das

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=20191007143310.GK21515@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=biju.das@bp.renesas.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=kbuild-all@01.org \
    --cc=kbuild@01.org \
    --cc=linux-usb@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;
as well as URLs for NNTP newsgroup(s).