Re: [PATCH] i2c: tegra: fix a possible NULL dereference

2016-01-23 Thread Wolfram Sang
> Perhaps is it better that I resent a version which use > of_device_get_match_data() ? I'd like that for both of your patches anyhow. It is more concise and better to read IMO. signature.asc Description: Digital signature

Re: [PATCH] i2c: tegra: fix a possible NULL dereference

2016-01-23 Thread Wolfram Sang
Hi Uwe, > That's equivalent to > > if (dev->of_node) > return of_driver_match_device(dev, drv); > > and was already suggested in the thread referenced from my reply to > http://article.gmane.org/gmane.linux.kernel/2083641 :-) Did you make a proper patch out of it? Can't

Re: [PATCH] i2c: tegra: fix a possible NULL dereference

2016-01-23 Thread Wolfram Sang
> Perhaps is it better that I resent a version which use > of_device_get_match_data() ? I'd like that for both of your patches anyhow. It is more concise and better to read IMO. signature.asc Description: Digital signature

Re: [PATCH] i2c: tegra: fix a possible NULL dereference

2016-01-23 Thread Wolfram Sang
Hi Uwe, > That's equivalent to > > if (dev->of_node) > return of_driver_match_device(dev, drv); > > and was already suggested in the thread referenced from my reply to > http://article.gmane.org/gmane.linux.kernel/2083641 :-) Did you make a proper patch out of it? Can't

Re: [PATCH] i2c: tegra: fix a possible NULL dereference

2015-11-12 Thread Thierry Reding
On Thu, Nov 12, 2015 at 03:54:58PM +0100, LABBE Corentin wrote: > On Thu, Nov 12, 2015 at 02:55:00PM +0100, Thierry Reding wrote: > > On Thu, Nov 12, 2015 at 02:45:20PM +0100, Uwe Kleine-König wrote: > > > On Thu, Nov 12, 2015 at 02:28:37PM +0100, Thierry Reding wrote: > > > > On Thu, Nov 12, 2015

Re: [PATCH] i2c: tegra: fix a possible NULL dereference

2015-11-12 Thread LABBE Corentin
On Thu, Nov 12, 2015 at 02:55:00PM +0100, Thierry Reding wrote: > On Thu, Nov 12, 2015 at 02:45:20PM +0100, Uwe Kleine-König wrote: > > On Thu, Nov 12, 2015 at 02:28:37PM +0100, Thierry Reding wrote: > > > On Thu, Nov 12, 2015 at 01:54:22PM +0100, LABBE Corentin wrote: > > > > On Thu, Nov 12, 2015

Re: [PATCH] i2c: tegra: fix a possible NULL dereference

2015-11-12 Thread Thierry Reding
On Thu, Nov 12, 2015 at 02:45:20PM +0100, Uwe Kleine-König wrote: > On Thu, Nov 12, 2015 at 02:28:37PM +0100, Thierry Reding wrote: > > On Thu, Nov 12, 2015 at 01:54:22PM +0100, LABBE Corentin wrote: > > > On Thu, Nov 12, 2015 at 01:29:23PM +0100, Thierry Reding wrote: > > > > On Thu, Nov 12, 2015

Re: [PATCH] i2c: tegra: fix a possible NULL dereference

2015-11-12 Thread Thierry Reding
On Thu, Nov 12, 2015 at 01:40:56PM +, Jon Hunter wrote: > > On 12/11/15 12:29, Thierry Reding wrote: > > * PGP Signed by an unknown key > > > > On Thu, Nov 12, 2015 at 08:26:03AM +0100, LABBE Corentin wrote: > >> of_match_device could return NULL, and so cause a NULL pointer > > > > No.

Re: [PATCH] i2c: tegra: fix a possible NULL dereference

2015-11-12 Thread Uwe Kleine-König
On Thu, Nov 12, 2015 at 02:28:37PM +0100, Thierry Reding wrote: > On Thu, Nov 12, 2015 at 01:54:22PM +0100, LABBE Corentin wrote: > > On Thu, Nov 12, 2015 at 01:29:23PM +0100, Thierry Reding wrote: > > > On Thu, Nov 12, 2015 at 08:26:03AM +0100, LABBE Corentin wrote: > > > > of_match_device could

Re: [PATCH] i2c: tegra: fix a possible NULL dereference

2015-11-12 Thread Jon Hunter
On 12/11/15 12:29, Thierry Reding wrote: > * PGP Signed by an unknown key > > On Thu, Nov 12, 2015 at 08:26:03AM +0100, LABBE Corentin wrote: >> of_match_device could return NULL, and so cause a NULL pointer > > No. There is no way that of_match_device() can ever fail. The driver > core uses

Re: [PATCH] i2c: tegra: fix a possible NULL dereference

2015-11-12 Thread Thierry Reding
On Thu, Nov 12, 2015 at 01:54:22PM +0100, LABBE Corentin wrote: > On Thu, Nov 12, 2015 at 01:29:23PM +0100, Thierry Reding wrote: > > On Thu, Nov 12, 2015 at 08:26:03AM +0100, LABBE Corentin wrote: > > > of_match_device could return NULL, and so cause a NULL pointer > > > > No. There is no way

Re: [PATCH] i2c: tegra: fix a possible NULL dereference

2015-11-12 Thread LABBE Corentin
On Thu, Nov 12, 2015 at 01:29:23PM +0100, Thierry Reding wrote: > On Thu, Nov 12, 2015 at 08:26:03AM +0100, LABBE Corentin wrote: > > of_match_device could return NULL, and so cause a NULL pointer > > No. There is no way that of_match_device() can ever fail. The driver > core uses the same table

Re: [PATCH] i2c: tegra: fix a possible NULL dereference

2015-11-12 Thread Thierry Reding
On Thu, Nov 12, 2015 at 08:26:03AM +0100, LABBE Corentin wrote: > of_match_device could return NULL, and so cause a NULL pointer No. There is no way that of_match_device() can ever fail. The driver core uses the same table to match the OF device to the driver, so the only case where

Re: [PATCH] i2c: tegra: fix a possible NULL dereference

2015-11-12 Thread Thierry Reding
On Thu, Nov 12, 2015 at 08:26:03AM +0100, LABBE Corentin wrote: > of_match_device could return NULL, and so cause a NULL pointer No. There is no way that of_match_device() can ever fail. The driver core uses the same table to match the OF device to the driver, so the only case where

Re: [PATCH] i2c: tegra: fix a possible NULL dereference

2015-11-12 Thread LABBE Corentin
On Thu, Nov 12, 2015 at 01:29:23PM +0100, Thierry Reding wrote: > On Thu, Nov 12, 2015 at 08:26:03AM +0100, LABBE Corentin wrote: > > of_match_device could return NULL, and so cause a NULL pointer > > No. There is no way that of_match_device() can ever fail. The driver > core uses the same table

Re: [PATCH] i2c: tegra: fix a possible NULL dereference

2015-11-12 Thread Jon Hunter
On 12/11/15 12:29, Thierry Reding wrote: > * PGP Signed by an unknown key > > On Thu, Nov 12, 2015 at 08:26:03AM +0100, LABBE Corentin wrote: >> of_match_device could return NULL, and so cause a NULL pointer > > No. There is no way that of_match_device() can ever fail. The driver > core uses

Re: [PATCH] i2c: tegra: fix a possible NULL dereference

2015-11-12 Thread Uwe Kleine-König
On Thu, Nov 12, 2015 at 02:28:37PM +0100, Thierry Reding wrote: > On Thu, Nov 12, 2015 at 01:54:22PM +0100, LABBE Corentin wrote: > > On Thu, Nov 12, 2015 at 01:29:23PM +0100, Thierry Reding wrote: > > > On Thu, Nov 12, 2015 at 08:26:03AM +0100, LABBE Corentin wrote: > > > > of_match_device could

Re: [PATCH] i2c: tegra: fix a possible NULL dereference

2015-11-12 Thread Thierry Reding
On Thu, Nov 12, 2015 at 02:45:20PM +0100, Uwe Kleine-König wrote: > On Thu, Nov 12, 2015 at 02:28:37PM +0100, Thierry Reding wrote: > > On Thu, Nov 12, 2015 at 01:54:22PM +0100, LABBE Corentin wrote: > > > On Thu, Nov 12, 2015 at 01:29:23PM +0100, Thierry Reding wrote: > > > > On Thu, Nov 12, 2015

Re: [PATCH] i2c: tegra: fix a possible NULL dereference

2015-11-12 Thread Thierry Reding
On Thu, Nov 12, 2015 at 01:40:56PM +, Jon Hunter wrote: > > On 12/11/15 12:29, Thierry Reding wrote: > > * PGP Signed by an unknown key > > > > On Thu, Nov 12, 2015 at 08:26:03AM +0100, LABBE Corentin wrote: > >> of_match_device could return NULL, and so cause a NULL pointer > > > > No.

Re: [PATCH] i2c: tegra: fix a possible NULL dereference

2015-11-12 Thread Thierry Reding
On Thu, Nov 12, 2015 at 01:54:22PM +0100, LABBE Corentin wrote: > On Thu, Nov 12, 2015 at 01:29:23PM +0100, Thierry Reding wrote: > > On Thu, Nov 12, 2015 at 08:26:03AM +0100, LABBE Corentin wrote: > > > of_match_device could return NULL, and so cause a NULL pointer > > > > No. There is no way

Re: [PATCH] i2c: tegra: fix a possible NULL dereference

2015-11-12 Thread LABBE Corentin
On Thu, Nov 12, 2015 at 02:55:00PM +0100, Thierry Reding wrote: > On Thu, Nov 12, 2015 at 02:45:20PM +0100, Uwe Kleine-König wrote: > > On Thu, Nov 12, 2015 at 02:28:37PM +0100, Thierry Reding wrote: > > > On Thu, Nov 12, 2015 at 01:54:22PM +0100, LABBE Corentin wrote: > > > > On Thu, Nov 12, 2015

Re: [PATCH] i2c: tegra: fix a possible NULL dereference

2015-11-12 Thread Thierry Reding
On Thu, Nov 12, 2015 at 03:54:58PM +0100, LABBE Corentin wrote: > On Thu, Nov 12, 2015 at 02:55:00PM +0100, Thierry Reding wrote: > > On Thu, Nov 12, 2015 at 02:45:20PM +0100, Uwe Kleine-König wrote: > > > On Thu, Nov 12, 2015 at 02:28:37PM +0100, Thierry Reding wrote: > > > > On Thu, Nov 12, 2015

[PATCH] i2c: tegra: fix a possible NULL dereference

2015-11-11 Thread LABBE Corentin
of_match_device could return NULL, and so cause a NULL pointer dereference later at line 809: i2c_dev->hw = match->data; Signed-off-by: LABBE Corentin --- drivers/i2c/busses/i2c-tegra.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/i2c/busses/i2c-tegra.c

[PATCH] i2c: tegra: fix a possible NULL dereference

2015-11-11 Thread LABBE Corentin
of_match_device could return NULL, and so cause a NULL pointer dereference later at line 809: i2c_dev->hw = match->data; Signed-off-by: LABBE Corentin --- drivers/i2c/busses/i2c-tegra.c | 3 +++ 1 file changed, 3 insertions(+) diff --git