kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
To: alcooperx@gmail.com, balbi@kernel.org,
	gregkh@linuxfoundation.org, f.fainelli@gmail.com
Cc: linux-usb@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
	Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Subject: [PATCH 1/2] usb: bdc: Fix an error handling path in 'bdc_probe()' when no suitable DMA config is available
Date: Wed, 18 Aug 2021 21:32:38 +0200	[thread overview]
Message-ID: <0c5910979f39225d5d8fe68c9ab1c147c68ddee1.1629314734.git.christophe.jaillet@wanadoo.fr> (raw)

If no suitable DMA configuration is available, a previous 'bdc_phy_init()'
call must be undone by a corresponding 'bdc_phy_exit()' call.

Branch to the existing error handling path instead of returning
directly.

Fixes: cc29d4f67757 ("usb: bdc: Add support for USB phy")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
checkpatch.pl warns that:
   WARNING: ENOTSUPP is not a SUSV4 error code, prefer EOPNOTSUPP
   #29: FILE: drivers/usb/gadget/udc/bdc/bdc_core.c:563:
   +			ret = -ENOTSUPP;
I've never seen this warning before and don't want to make a blind fix for that.
Let me know if I should fix it or not.
---
drivers/usb/gadget/udc/bdc/bdc_core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/udc/bdc/bdc_core.c b/drivers/usb/gadget/udc/bdc/bdc_core.c
index 0bef6b3f049b..251db57e51fa 100644
--- a/drivers/usb/gadget/udc/bdc/bdc_core.c
+++ b/drivers/usb/gadget/udc/bdc/bdc_core.c
@@ -560,7 +560,8 @@ static int bdc_probe(struct platform_device *pdev)
 		if (ret) {
 			dev_err(dev,
 				"No suitable DMA config available, abort\n");
-			return -ENOTSUPP;
+			ret = -ENOTSUPP;
+			goto phycleanup;
 		}
 		dev_dbg(dev, "Using 32-bit address\n");
 	}
-- 
2.30.2


             reply	other threads:[~2021-08-18 19:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-18 19:32 Christophe JAILLET [this message]
2021-08-18 19:32 ` [PATCH 2/2] usb: bdc: Fix a resource leak in the error handling path of 'bdc_probe()' Christophe JAILLET
2021-08-20 20:03   ` Florian Fainelli
2021-08-31 13:42     ` Alan Cooper
2021-08-20 20:01 ` [PATCH 1/2] usb: bdc: Fix an error handling path in 'bdc_probe()' when no suitable DMA config is available Florian Fainelli

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=0c5910979f39225d5d8fe68c9ab1c147c68ddee1.1629314734.git.christophe.jaillet@wanadoo.fr \
    --to=christophe.jaillet@wanadoo.fr \
    --cc=alcooperx@gmail.com \
    --cc=balbi@kernel.org \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=f.fainelli@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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).