From patchwork Mon May 18 17:36:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 225785 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2EE2C433E0 for ; Mon, 18 May 2020 17:57:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9B17220835 for ; Mon, 18 May 2020 17:57:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589824634; bh=mLNNcdMEzcijcd6WQUrQiMn6mZLH+CN0WL25fCbmqLo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=U/Zj1Gx8ZDbHFQ5MR7lhLW9PDC1Wk0moCdjkf/4A7+ukLA+noRixGOB1DyIA2s+g4 L1jxW70T2ZzWGQp997ll0tYnkrQM5tmRbtZtHDGn4KrWabNs4q3yDer7vn/tOEhIw2 Wg2Vj+TAqMi78BY3vrXfl+nXoEQjsAdZXiLcz6gA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731749AbgERR5N (ORCPT ); Mon, 18 May 2020 13:57:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:35610 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731745AbgERR5N (ORCPT ); Mon, 18 May 2020 13:57:13 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 025FD207C4; Mon, 18 May 2020 17:57:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589824632; bh=mLNNcdMEzcijcd6WQUrQiMn6mZLH+CN0WL25fCbmqLo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dFsiuk8TdRwcc/6M6QpsB3BRjdG0HefWSwk5uy0JURT0aJsY/lHKdR5eZUGJaAD2K 6wep46i7OYPqui6Z0nWJHZWwNLwTSmq4lqoFtFV+tOMCK3814/B0vYPAm8tGWHUy+b SS7vGTSjs3WNNo3Vt2EqGIC6D58bS/32eFf+v5Qg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Wei Yongjun , Ursula Braun , "David S. Miller" , Sasha Levin Subject: [PATCH 5.4 090/147] s390/ism: fix error return code in ism_probe() Date: Mon, 18 May 2020 19:36:53 +0200 Message-Id: <20200518173524.760943045@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200518173513.009514388@linuxfoundation.org> References: <20200518173513.009514388@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Wei Yongjun [ Upstream commit 29b74cb75e3572d83708745e81e24d37837415f9 ] Fix to return negative error code -ENOMEM from the smcd_alloc_dev() error handling case instead of 0, as done elsewhere in this function. Fixes: 684b89bc39ce ("s390/ism: add device driver for internal shared memory") Reported-by: Hulk Robot Signed-off-by: Wei Yongjun Signed-off-by: Ursula Braun Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/s390/net/ism_drv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/s390/net/ism_drv.c b/drivers/s390/net/ism_drv.c index 4fc2056bd2272..e615dc240150b 100644 --- a/drivers/s390/net/ism_drv.c +++ b/drivers/s390/net/ism_drv.c @@ -521,8 +521,10 @@ static int ism_probe(struct pci_dev *pdev, const struct pci_device_id *id) ism->smcd = smcd_alloc_dev(&pdev->dev, dev_name(&pdev->dev), &ism_ops, ISM_NR_DMBS); - if (!ism->smcd) + if (!ism->smcd) { + ret = -ENOMEM; goto err_resource; + } ism->smcd->priv = ism; ret = ism_dev_init(ism);