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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160721091438.GL1041@n2100.armlinux.org.uk>
Date:	Thu, 21 Jul 2016 10:14:38 +0100
From:	Russell King - ARM Linux <linux@...linux.org.uk>
To:	Peter Chen <peter.chen@....com>
Cc:	gregkh@...uxfoundation.org, stern@...land.harvard.edu,
	ulf.hansson@...aro.org, broonie@...nel.org, sre@...nel.org,
	robh+dt@...nel.org, shawnguo@...nel.org, dbaryshkov@...il.com,
	dwmw2@...radead.org, mark.rutland@....com,
	devicetree@...r.kernel.org, k.kozlowski@...sung.com,
	stephen.boyd@...aro.org, oscar@...andei.net, arnd@...db.de,
	pawel.moll@....com, linux-pm@...r.kernel.org,
	linux-kernel@...r.kernel.org, s.hauer@...gutronix.de,
	linux-usb@...r.kernel.org, mail@...iej.szmigiero.name,
	troy.kisky@...ndarydevices.com, stillcompiling@...il.com,
	Peter Chen <peter.chen@...escale.com>, p.zabel@...gutronix.de,
	festevam@...il.com, linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH v3 5/6] usb: chipidea: let chipidea core device of_node
 equal's glue layer device of_node

On Wed, Jul 20, 2016 at 05:40:28PM +0800, Peter Chen wrote:
> diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
> index 69426e6..0d05812 100644
> --- a/drivers/usb/chipidea/core.c
> +++ b/drivers/usb/chipidea/core.c
> @@ -914,6 +914,16 @@ static int ci_hdrc_probe(struct platform_device *pdev)
>  	if (!ci)
>  		return -ENOMEM;
>  
> +	/*
> +	 * At device tree, we have no device node for chipidea core,
> +	 * the glue layer's node is the parent node for host and udc
> +	 * device. But in related driver, the parent device is chipidea
> +	 * core. So, in order to let the common driver get parent's node,
> +	 * we let the core's device node equals glue layer's node.
> +	 */
> +	if (dev->parent && dev->parent->of_node)
> +		dev->of_node = dev->parent->of_node;

This is a dangerous thing to do.  You're changing the dev->of_node of
_this_ device, which means that _this_ driver will no longer match
the device if you remove and reinsert the driver module, or unbind
and try to re-bind the device to this driver.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ