linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] misc: mic: Replace kmalloc with kzalloc in the error message
@ 2020-05-29  1:01 Yi Wang
  2020-05-29  5:38 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Yi Wang @ 2020-05-29  1:01 UTC (permalink / raw)
  To: sudeep.dutt
  Cc: ashutosh.dixit, arnd, gregkh, alexios.zavras, tglx, allison,
	linux-kernel, xue.zhihong, wang.yi59, wang.liang82,
	Liao Pingfang

From: Liao Pingfang <liao.pingfang@zte.com.cn>

Use kzalloc instead of kmalloc in the error message according to
the previous kzalloc() call.

Signed-off-by: Liao Pingfang <liao.pingfang@zte.com.cn>
---
 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);
 		goto mdev_alloc_fail;
 	}
 	mdev->id = ida_simple_get(&g_mic_ida, 0, MIC_MAX_NUM_DEVS, GFP_KERNEL);
-- 
2.9.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] misc: mic: Replace kmalloc with kzalloc in the error message
  2020-05-29  1:01 [PATCH] misc: mic: Replace kmalloc with kzalloc in the error message Yi Wang
@ 2020-05-29  5:38 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2020-05-29  5:38 UTC (permalink / raw)
  To: Yi Wang
  Cc: sudeep.dutt, ashutosh.dixit, arnd, alexios.zavras, tglx, allison,
	linux-kernel, xue.zhihong, wang.liang82, Liao Pingfang

On Fri, May 29, 2020 at 09:01:21AM +0800, Yi Wang wrote:
> From: Liao Pingfang <liao.pingfang@zte.com.cn>
> 
> Use kzalloc instead of kmalloc in the error message according to
> the previous kzalloc() call.
> 
> Signed-off-by: Liao Pingfang <liao.pingfang@zte.com.cn>
> ---
>  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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-05-29  5:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-29  1:01 [PATCH] misc: mic: Replace kmalloc with kzalloc in the error message Yi Wang
2020-05-29  5:38 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).