Re: [PATCH v5 2/4] w1: ds2482: switch to devm_kzalloc() from kzalloc()

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

 



On 29/11/2024 10:53, Kryštof Černý via B4 Relay wrote:
>  	/* Detect the 8-port version */
> @@ -505,21 +503,15 @@ static int ds2482_probe(struct i2c_client *client)
>  		err = w1_add_master_device(&data->w1_ch[idx].w1_bm);
>  		if (err) {
>  			data->w1_ch[idx].pdev = NULL;
> -			goto exit_w1_remove;
> +			for (idx = 0; idx < data->w1_count; idx++) {
> +				if (data->w1_ch[idx].pdev != NULL)
> +					w1_remove_master_device(&data->w1_ch[idx].w1_bm);
> +			}
> +			return err;
>  		}
>  	}
>  
>  	return 0;
> -
> -exit_w1_remove:
> -	for (idx = 0; idx < data->w1_count; idx++) {
> -		if (data->w1_ch[idx].pdev != NULL)
> -			w1_remove_master_device(&data->w1_ch[idx].w1_bm);

This exit path should stay.

> -	}
> -exit_free:
> -	kfree(data);
> -exit:
> -	return err;
>  }
>  
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