From patchwork Mon Oct 16 17:32:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 10009413 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1E080601D5 for ; Mon, 16 Oct 2017 17:33:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0BA0D28687 for ; Mon, 16 Oct 2017 17:33:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0025D28689; Mon, 16 Oct 2017 17:33:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9B39428687 for ; Mon, 16 Oct 2017 17:33:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753927AbdJPRdS (ORCPT ); Mon, 16 Oct 2017 13:33:18 -0400 Received: from mout.web.de ([217.72.192.78]:53217 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753392AbdJPRdR (ORCPT ); Mon, 16 Oct 2017 13:33:17 -0400 Received: from [192.168.1.2] ([78.49.107.148]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0Lb29N-1dOReu2lvl-00kdZg; Mon, 16 Oct 2017 19:33:01 +0200 Subject: [PATCH 2/4] char/tpm: Delete an error message for a failed memory allocation in tpm_ibmvtpm_probe() From: SF Markus Elfring To: linux-integrity@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Andy Shevchenko , Benjamin Herrenschmidt , Corentin Labbe , Jarkko Sakkinen , Jason Gunthorpe , Jerry Snitselaar , Kenneth Goldman , Michael Ellerman , Nayna Jain , Paul Mackerras , =?UTF-8?Q?Peter_H=c3=bcwe?= , Stefan Berger Cc: LKML , kernel-janitors@vger.kernel.org References: <1d3516a2-a8e6-9e95-d438-f115fac84c7f@users.sourceforge.net> Message-ID: <2ed7178a-347e-7e56-4edd-977687aaad66@users.sourceforge.net> Date: Mon, 16 Oct 2017 19:32:59 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <1d3516a2-a8e6-9e95-d438-f115fac84c7f@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:jOxa7oQYyqOptSB8aVnn5AWyD658w4tNjaVuzUUJq7n75cTTR5q cHhZE2MEDImoC/ivUJ79USS2H9kGO6DcheTCmxYZFTzFNKqArGroJJbFDH2pWDw00xrJ9p7 qSGlwADRUy/2XfzEq1TnUoh+HRxBGRZ761EByZzK+RU/qYBVEKmQB+ZrpNOIJHpXslrt1sA xyO4mIZw9D8icCva5394Q== X-UI-Out-Filterresults: notjunk:1; V01:K0:BdDllyhH2Sk=:wwKj+EcjPzK5CxnW9/aafq 6IdaACOVxrCUmBCFGFnLl4KHFJvVMMSKerUTGwRetfEgoH/NOJecCNszItzZ1Q11E2iPLSKUd 2zX4ubcD6bVNXh97YoH9x71Pc5uznjzNz2LpPldSv7UZO8Kr4dAtu9A6QTesNwoUnKLJS13l4 XO3KoRMtgEozuivlKGxjppQBYikWiZ85rxdmtNOn9GGwX0NCVtVXDr6cyoMxrCeEjS+fVKdd8 O9zGH4gGQhEC1CtLquD4hpvV7T7ucg+eKD4ExAaG+V4S6lOIdr0gRf8azk8VEwgBeJEBE0l8N 57sK8m3v9/15VIht5lxG81nhMhfZ2JGygKwmr1juNEXVYjaNSU2GUZEGN4+8a+b9vn9Vvrkst XJhgR57HeXK6szlpjJfUFltAtZTk2hlpsUuAjPpLwoz9bYk/YkEZdLJPrmGlcANFSoQquaVjb XrDLlJgaL8ijEvzsNcxaDEH7sCqNg4veKA0480j011Vck1t6vQDYKs5kvzaCw1yMyC1bVogtw +Si1dVSC32s9kILk7/8raylH7qnJLdjSIPJlg25IqNQooOydNobzRdu79+Z9/YGg97K9/M/es YK8Ravpi5hOJiLUVToglaEBRw92+bIQalpUf+awGhh70qrZmroYjHK/c3ciKI08UDPhoCU8LK rtUjxXIvumQrTy1mPFkbjv/PVdBZdteSsm85vYm5osI0SVpPvVw70QPn+R2V3vcpK8e3ocqrN h3NMdfIDw2XZXz5H867//P17YQvyH/BnRws4fczrGz7VuC1+wDdIBlOt55vN+jJU/JvI2mgy7 bwph1BddVbIQVz9t03KN9A8Bsbv56gMgtbkrJb92d8BJqmyeK4= Sender: linux-integrity-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-integrity@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Mon, 16 Oct 2017 18:08:23 +0200 Omit an extra message for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/char/tpm/tpm_ibmvtpm.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/char/tpm/tpm_ibmvtpm.c b/drivers/char/tpm/tpm_ibmvtpm.c index 25f6e2665385..b18148ef2612 100644 --- a/drivers/char/tpm/tpm_ibmvtpm.c +++ b/drivers/char/tpm/tpm_ibmvtpm.c @@ -609,10 +609,8 @@ static int tpm_ibmvtpm_probe(struct vio_dev *vio_dev, return PTR_ERR(chip); ibmvtpm = kzalloc(sizeof(struct ibmvtpm_dev), GFP_KERNEL); - if (!ibmvtpm) { - dev_err(dev, "kzalloc for ibmvtpm failed\n"); + if (!ibmvtpm) goto cleanup; - } ibmvtpm->dev = dev; ibmvtpm->vdev = vio_dev;