Re: [PATCH 1/2] media: ir-kbd-i2c: prevent potential NULL pointer access

2019-07-25 Thread Sean Young
Hi Wolfram, On Thu, Jul 25, 2019 at 09:55:38AM +0200, Wolfram Sang wrote: > Hi Sean, > > thanks for the review! > > On Thu, Jul 25, 2019 at 06:12:02AM +0100, Sean Young wrote: > > On Mon, Jul 22, 2019 at 07:26:31PM +0200, Wolfram Sang wrote: > > > i2c_new_dummy() can fail returning a NULL pointe

Re: [PATCH 1/2] media: ir-kbd-i2c: prevent potential NULL pointer access

2019-07-25 Thread Wolfram Sang
Hi Sean, thanks for the review! On Thu, Jul 25, 2019 at 06:12:02AM +0100, Sean Young wrote: > On Mon, Jul 22, 2019 at 07:26:31PM +0200, Wolfram Sang wrote: > > i2c_new_dummy() can fail returning a NULL pointer. The code does not > > bail out in this case and the returned pointer is blindly used.

Re: [PATCH 1/2] media: ir-kbd-i2c: prevent potential NULL pointer access

2019-07-24 Thread Sean Young
On Mon, Jul 22, 2019 at 07:26:31PM +0200, Wolfram Sang wrote: > i2c_new_dummy() can fail returning a NULL pointer. The code does not > bail out in this case and the returned pointer is blindly used. I don't see how. The existing code tries to set up the tx part; if i2c_new_dummy() return NULL then

[PATCH 1/2] media: ir-kbd-i2c: prevent potential NULL pointer access

2019-07-22 Thread Wolfram Sang
i2c_new_dummy() can fail returning a NULL pointer. The code does not bail out in this case and the returned pointer is blindly used. Convert to devm_i2c_new_dummy_device() which returns an ERR_PTR and also bail out when failing the validity check. Signed-off-by: Wolfram Sang --- drivers/media/i2