Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934858AbeAIS2k (ORCPT + 1 other); Tue, 9 Jan 2018 13:28:40 -0500 Received: from mout.web.de ([212.227.15.14]:55220 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753286AbeAIS2j (ORCPT ); Tue, 9 Jan 2018 13:28:39 -0500 Subject: [PATCH 1/5] misc/pti: Delete an error message for a failed memory allocation in two functions From: SF Markus Elfring To: kernel-janitors@vger.kernel.org, Arnd Bergmann , Greg Kroah-Hartman Cc: LKML References: Message-ID: <0711078d-249c-3f1d-edaa-877d48de2ea7@users.sourceforge.net> Date: Tue, 9 Jan 2018 19:28:36 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:AaTAz4Eho4mIwUuBc/yT/SI6EaWfTJ+IxxKLlYwNfvrlloEKev6 +wOWw2lWG/ny47cLyCzQj7+NhqpFRmz3F+o4VXiIl0hKoA5Drsv3MCdp9J0NnNPoZQexeRW NyPgFjQufy8RdcActMWPhe7WCIM9PivKtgapenqFae0/0AjXXEAOFQzeauartv/0BvYd7ol h4DvYeQRYo1gRop8ASG3w== X-UI-Out-Filterresults: notjunk:1;V01:K0:GiNLG2GxMfA=:z9znP6/fpiZVBORmcMw4Qa z6B0vTX3zEoKksU1addV7z2hH6MFPm7mqVU2gDC0o6K08HjHQvtXeYjXldLVAHj2zf/qUi+vU 2m2VNGJDh/iRFPp28wIpYcFrKXIxXz40b6vCfq4Ag5+j9+0Bmq3W+yA6nPIEudxOs/7VIHt7C 6cKp0dsp4zsS8u/lVpinGfvEXn2POkWHf1pQOVSQQOPLbFzeiHhVOaAqkt77llpbJQiE7+Mhn QoGkLAzuniWRnX1UhrL2k6RNiR47xpV6SjcsGieCexU+ALivS+VU/g6E5tLvR4iAMIohcyXp7 WVmXReLrBXUmrF6MNDzJJWa5z21hN1/2mkvyWD6fGyVivlVxNringT24bmgy50HKzMBjOrzDt EqEHEQSYKNbNfO9v8w0BLhLDTIQDVClv8GzQULWi5am3hE/ik5/nRYBb4/du2bsTIrZGbaH0W 1Pyqp2eaR1VxM+AQgqN/5pFnpW9jQ130Tokg3xg2E74Lh9zSCaZGdAeZi4NPySKiR2RtcMOZF TcIFXNx4FWYQw7CJ0A0bHtP2WN/GrsxU5zy4Y2WRPGUqxISoPiaXgxVAaIH1TWF6UJURB+h4Z w6H8Kb8LQ7A9HI4OwfIghAIxV+LrmGqyteiOzTmp5Bdy7ybFJm6Eqb9H2bhh30EHxqKOFFhXK CF+sRhQBiU5MHtX4r8N7hnABYgH9k6mJ0pIaIS6FVXp+sWsB9P6pif5e8fTlMTVWkn9Lx0Gb6 KKZdli/V00R0OorPTyNp5Wp8QZXmsZ4N+Zu7nXPVnj9b7O0Yzx4ogSCpZCalZwoL6Kbl49TOW vdTULxVlF1agDnFARVX+duSAa2a8YWBaHOav6imu6fUgy9inSw= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: From: Markus Elfring 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 --- 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