lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 14 Nov 2014 21:01:49 +0000
From:	Paul Zimmerman <Paul.Zimmerman@...opsys.com>
To:	"dinguyen@...nsource.altera.com" <dinguyen@...nsource.altera.com>,
	"balbi@...com" <balbi@...com>
CC:	"dinh.linux@...il.com" <dinh.linux@...il.com>,
	"swarren@...dotorg.org" <swarren@...dotorg.org>,
	"b.zolnierkie@...sung.com" <b.zolnierkie@...sung.com>,
	"matthijs@...in.nl" <matthijs@...in.nl>,
	"r.baldyga@...sung.com" <r.baldyga@...sung.com>,
	"jg1.han@...sung.com" <jg1.han@...sung.com>,
	"sachin.kamat@...aro.org" <sachin.kamat@...aro.org>,
	"ben-linux@...ff.org" <ben-linux@...ff.org>,
	"dianders@...omium.org" <dianders@...omium.org>,
	"kever.yang@...k-chips.com" <kever.yang@...k-chips.com>,
	"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCHv7 6/8] usb: dwc2: gadget: Do not fail probe if there
 isn't a clock node

> From: dinguyen@...nsource.altera.com [mailto:dinguyen@...nsource.altera.com]
> Sent: Tuesday, November 11, 2014 9:14 AM
> 
> From: Dinh Nguyen <dinguyen@...nsource.altera.com>
> 
> Since the dwc2 hcd driver is currently not looking for a clock node during
> init, we should not completely fail if there isn't a clock provided.
> By assigning clk = NULL, this allows the driver, when configured for dual-role
> mode, to be able to continue loading the host portion of the driver when
> a clock node is not specified.
> 
> Signed-off-by: Dinh Nguyen <dinguyen@...nsource.altera.com>
> ---
> v7: Reworked to use clk=NULL and remove the need to is IS_ERR(clk)
> v6: none
> v5: reworked to not access gadget functions from the hcd.
> ---
>  drivers/usb/dwc2/gadget.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
> index 37c7916..367689b 100644
> --- a/drivers/usb/dwc2/gadget.c
> +++ b/drivers/usb/dwc2/gadget.c
> @@ -3431,6 +3431,7 @@ int dwc2_gadget_init(struct dwc2_hsotg *hsotg, int irq)
> 
>  	hsotg->clk = devm_clk_get(dev, "otg");
>  	if (IS_ERR(hsotg->clk)) {
> +		hsotg->clk = NULL;
>  		dev_err(dev, "cannot get otg clock\n");
>  		return PTR_ERR(hsotg->clk);
>  	}

Whoops, you just broke the return value, since you NULL out
hsotg->clk and then call PTR_ERR() on it.

-- 
Paul

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ