Re: [PATCH 1/1] hwmon: (ina2xx) initialize mutex before locking

2018-04-16 Thread Guenter Roeck
On Mon, Apr 16, 2018 at 10:53:23PM +0500, ahsan_huss...@mentor.com wrote: > From: Ahsan Hussain > > Upstream commit 8d008c0c ("hwmon: (ina2xx) Make calibration register > value fixed"), makes ina2xx_set_shunt() call mutex_lock on an > un-initialized mutex. Initialize it prior so we don't get a NU

[PATCH 1/1] hwmon: (ina2xx) initialize mutex before locking

2018-04-16 Thread ahsan_hussain
From: Ahsan Hussain Upstream commit 8d008c0c ("hwmon: (ina2xx) Make calibration register value fixed"), makes ina2xx_set_shunt() call mutex_lock on an un-initialized mutex. Initialize it prior so we don't get a NULL pointer dereference error. Fixes: 8d008c0c ("hwmon: (ina2xx) Make calibration re

Re: [PATCH 1/1] hwmon: (ina2xx) initialize mutex before locking

2018-04-16 Thread Guenter Roeck
On Mon, Apr 16, 2018 at 10:48:03PM +0500, Ahsan Hussain wrote: > > > On 04/16/2018 10:28 PM, Guenter Roeck wrote: > > On Mon, Apr 16, 2018 at 10:08:19PM +0500, Ahsan Hussain wrote: > >> > >> Upstream commit > >> > >> 8d008c0c ("hwmon: (ina2xx) Make calibration register value fixed") > >> > > This

Re: [PATCH 1/1] hwmon: (ina2xx) initialize mutex before locking

2018-04-16 Thread Ahsan Hussain
On 04/16/2018 10:28 PM, Guenter Roeck wrote: > On Mon, Apr 16, 2018 at 10:08:19PM +0500, Ahsan Hussain wrote: >> >> Upstream commit >> >> 8d008c0c ("hwmon: (ina2xx) Make calibration register value fixed") >> > This doesn't have to be on separate lines; as written, it just causes > confusion. > W

Re: [PATCH 1/1] hwmon: (ina2xx) initialize mutex before locking

2018-04-16 Thread Guenter Roeck
On Mon, Apr 16, 2018 at 10:08:19PM +0500, Ahsan Hussain wrote: > > Upstream commit > > 8d008c0c ("hwmon: (ina2xx) Make calibration register value fixed") > This doesn't have to be on separate lines; as written, it just causes confusion. > makes ina2xx_set_shunt() call mutex_lock on an un-initia

[PATCH 1/1] hwmon: (ina2xx) initialize mutex before locking

2018-04-16 Thread Ahsan Hussain
Upstream commit 8d008c0c ("hwmon: (ina2xx) Make calibration register value fixed") makes ina2xx_set_shunt() call mutex_lock on an un-initialized mutex. Initialize it prior so we don't get a NULL pointer dereference error Signed-off-by: Ahsan Hussain --- drivers/hwmon/ina2xx.c | 4 ++-- 1 file