Re: [PATCH] misc: mic: Replace kmalloc with kzalloc in the error message

From: Greg KH
Date: Fri May 29 2020 - 01:38:43 EST


On Fri, May 29, 2020 at 09:01:21AM +0800, Yi Wang wrote:
> From: Liao Pingfang <liao.pingfang@xxxxxxxxxx>
>
> Use kzalloc instead of kmalloc in the error message according to
> the previous kzalloc() call.
>
> Signed-off-by: Liao Pingfang <liao.pingfang@xxxxxxxxxx>
> ---
> drivers/misc/mic/host/mic_main.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/misc/mic/host/mic_main.c b/drivers/misc/mic/host/mic_main.c
> index be0784f..8296f31 100644
> --- a/drivers/misc/mic/host/mic_main.c
> +++ b/drivers/misc/mic/host/mic_main.c
> @@ -164,7 +164,7 @@ static int mic_probe(struct pci_dev *pdev,
> mdev = kzalloc(sizeof(*mdev), GFP_KERNEL);
> if (!mdev) {
> rc = -ENOMEM;
> - dev_err(&pdev->dev, "mdev kmalloc failed rc %d\n", rc);
> + dev_err(&pdev->dev, "mdev kzalloc failed rc %d\n", rc);

The message should just be dropped as the call will print the failure
message anyway.

thanks,

greg k-h