Re: [PATCH v4 2/3] w1: ds2482: Add regulator support

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

 



On 27/11/2024 15:21, Kryštof Černý wrote:
> 			     I2C_FUNC_SMBUS_WRITE_BYTE_DATA |
>> @@ -457,6 +459,10 @@ static int ds2482_probe(struct i2c_client *client)
>>   		goto exit;
>>   	}
>>   
>> +	ret = devm_regulator_get_enable(&client->dev, "vcc");
>> +	if (ret)
>> +		return dev_err_probe(&client->dev, ret, "Failed to enable regulator\n");
> 
> This will cause a memory leak of `data`, I would refactor the driver a 
> bit in the next patch revision. Should I create a separate commit that 
> switches from kzalloc() to devm_kzalloc() or keep it in patch 2/3? The 
> separate commits way seems correct to me, so it is clearly 
> distinguished. Sorry that I missed it.
Separate commit, please.

Best regards,
Krzysztof




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux