lkml.org 
[lkml]   [2018]   [Jan]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 1/5] misc/pti: Delete an error message for a failed memory allocation in two functions
From
Date
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 9 Jan 2018 18:00:15 +0100

Omit an extra message for a memory allocation failure in these functions.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/misc/pti.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/misc/pti.c b/drivers/misc/pti.c
index 41f2a9f6851d..92a1a20839c8 100644
--- a/drivers/misc/pti.c
+++ b/drivers/misc/pti.c
@@ -619,11 +619,8 @@ static ssize_t pti_char_write(struct file *filp, const char __user *data,
mc = filp->private_data;

kbuf = kmalloc(size, GFP_KERNEL);
- if (kbuf == NULL) {
- pr_err("%s(%d): buf allocation failed\n",
- __func__, __LINE__);
+ if (!kbuf)
return -ENOMEM;
- }

do {
if (len - n > USER_COPY_SIZE)
@@ -826,9 +823,6 @@ static int pti_pci_probe(struct pci_dev *pdev,
drv_data = kzalloc(sizeof(*drv_data), GFP_KERNEL);
if (drv_data == NULL) {
retval = -ENOMEM;
- dev_err(&pdev->dev,
- "%s(%d): kmalloc() returned NULL memory.\n",
- __func__, __LINE__);
goto err_disable_pci;
}
drv_data->pti_addr = pci_resource_start(pdev, pci_bar);
--
2.15.1
\
 
 \ /
  Last update: 2018-01-14 23:20    [W:0.036 / U:0.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site