Re: [PATCH 3/4] media: atomisp: mt9m114: Add missing mutex_init() call

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On 14-Oct-24 1:31 PM, Andy Shevchenko wrote:
> On Sun, Oct 13, 2024 at 05:40:55PM +0200, Hans de Goede wrote:
>> The input_lock was not being initialized, fix this.
>>
>> Also switch to devm_kzalloc() for the main driver data struct, so that
>> devm_mutex_init() can be used for this.
> 
> ...
> 
>>  		ret = mt9m114_s_config(&dev->sd, client->irq, pdata);
>>  	if (!pdata || ret) {
> 
> Hmm... What is the ret value when no pdata is provided?

0, so this error-exit leaves the driver bound (pre-existing problem)

The error handling in the probe function is quite foobar in general,
but I just wanted to get the driver working as a POC / to have
a known working setup before focusing on using the other driver
since that is the way forward.

Regards,

Hans




> 
>>  		v4l2_device_unregister_subdev(&dev->sd);
>> -		kfree(dev);
>>  		return ret;
>>  	}
> 
> ...
> 
>>  	ret = atomisp_register_i2c_module(&dev->sd, pdata);
>>  	if (ret) {
>>  		v4l2_device_unregister_subdev(&dev->sd);
>> -		kfree(dev);
>>  		/* Coverity CID 298095 - return on error */
> 
> This comment is useless. But it seems we tend to drop this code completely in
> the future.
> 
>>  		return ret;
>>  	}
> 





[Index of Archives]     [Linux Driver Development]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux