Re: [PATCH 2/2] [media] stm32-dcmi: Improve four size determinations

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

 



On Fri, 2017-09-15 at 19:29 +0200, SF Markus Elfring wrote:
> diff --git a/drivers/media/platform/stm32/stm32-dcmi.c b/drivers/media/platform/stm32/stm32-dcmi.c
[]
> @@ -1372,9 +1372,8 @@ static int dcmi_formats_init(struct stm32_dcmi *dcmi)
>  	dcmi->sd_formats = devm_kcalloc(dcmi->dev,
> -					num_fmts, sizeof(struct dcmi_format *),
> +					num_fmts, sizeof(*dcmi->sd_formats),
>  					GFP_KERNEL);
>  	if (!dcmi->sd_formats)
>  		return -ENOMEM;
>  
> -	memcpy(dcmi->sd_formats, sd_fmts,
> -	       num_fmts * sizeof(struct dcmi_format *));
> +	memcpy(dcmi->sd_formats, sd_fmts, num_fmts * sizeof(*dcmi->sd_formats));

devm_kmemdup




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux