public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: SF Markus Elfring <elfring@users.sourceforge.net>
To: kernel-janitors@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 1/5] misc/pti: Delete an error message for a failed memory allocation in two functions
Date: Tue, 09 Jan 2018 18:28:36 +0000	[thread overview]
Message-ID: <0711078d-249c-3f1d-edaa-877d48de2ea7@users.sourceforge.net> (raw)
In-Reply-To: <bd359852-a809-280d-3d52-89216edc2058@users.sourceforge.net>

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


  reply	other threads:[~2018-01-09 18:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-09 18:27 [PATCH 0/5] misc-PTI: Adjustments for some function implementations SF Markus Elfring
2018-01-09 18:28 ` SF Markus Elfring [this message]
2018-01-09 18:29 ` [PATCH 2/5] misc/pti: Fix a typo in five comment lines SF Markus Elfring
2018-01-09 18:31 ` [PATCH 3/5] misc/pti: Improve a size determination in two functions SF Markus Elfring
2018-01-09 18:32 ` [PATCH 4/5] misc/pti: Adjust 11 checks for null pointers SF Markus Elfring
2018-01-09 18:33 ` [PATCH 5/5] misc/pti: Delete an unnecessary return statement in two functions SF Markus Elfring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0711078d-249c-3f1d-edaa-877d48de2ea7@users.sourceforge.net \
    --to=elfring@users.sourceforge.net \
    --cc=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox