Received: by 10.192.165.148 with SMTP id m20csp784207imm; Fri, 27 Apr 2018 07:28:43 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpUPElhM33VqfRB4ly2FIro7e5PL1IRR9peluVDo20ofXAg3cmL/pfxP6AcbKCS9qvNxxPv X-Received: by 2002:a17:902:820a:: with SMTP id x10-v6mr2481323pln.203.1524839323581; Fri, 27 Apr 2018 07:28:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524839323; cv=none; d=google.com; s=arc-20160816; b=0zRUflyMn//HehPAdE+79NNQWEFwt1hEFa4SGN7zy90IiW56fH70GiwP+JZCqlnsAz 6EANxDPuLI+WkAIUNLNF5RsLwwKENxbwCsgiFq4v4k0EtEiRcaUdeCA44Rhw7BKGXYdC 7e1VCJNZ3hwUzhPNEIREVXYRlj5wy93cko/wupu8uQRNuWf73ADuDClNDRm9ajcE5wov O8L91UbESiaeW/36P14wMiedtL2e4BB+YNt8TclbfI1P8yMeQ9u58eh2rH2inbyG3I1y YAIZOziLNQvotKYQvypk4s7D6WhPXCvaDGf6mTfjhP1rAHarpvTMhtLFECRVZDgHujXc JnjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dmarc-filter :arc-authentication-results; bh=vlXjXpJeFcwXW/1XAb5r2ougMe60e7YsfqsyVNhJ94s=; b=y/kbvEq7nvo7s/x7JfSk9JvEAwisIOB3K/b+bNIfQTohUkJzkPmmUsURIx1fauTH+R 7vgjoaHyn3/RGVDwjcLqmIoXYCN8wGsSSbYSdhRqyPvZtI5sXoLwi0cE6Hu19CwpedCd f3sHOKplROaxETsXKwJq5cp1OA0rRqF1tETThfKYH7/2pUS8q5cPBkzNBMTMy9mL2nac QO8sZs4r5mgSkP7AHkNjQsYzqmMK5yEZntIWj62RkyXykkB9x8PCHztkU4wzShEpXJav PFKZCQe1j5vvy8D1cRD685q2xV/sl5yn2P25SxjbfvR8dvk4PtvhrsXkwOV/xXYmuzis SMYg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r11-v6si1366686pgn.104.2018.04.27.07.28.29; Fri, 27 Apr 2018 07:28:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935033AbeD0OLd (ORCPT + 99 others); Fri, 27 Apr 2018 10:11:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:56262 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935016AbeD0OL0 (ORCPT ); Fri, 27 Apr 2018 10:11:26 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (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 C5CC321892; Fri, 27 Apr 2018 14:11:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C5CC321892 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=fail smtp.mailfrom=gregkh@linuxfoundation.org From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Julian Wiedmann , "David S. Miller" Subject: [PATCH 4.16 49/81] s390/qeth: handle failure on workqueue creation Date: Fri, 27 Apr 2018 15:58:51 +0200 Message-Id: <20180427135746.006010437@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180427135743.216853156@linuxfoundation.org> References: <20180427135743.216853156@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Julian Wiedmann [ Upstream commit a936b1ef37ce1e996533878f4b23944f9444dcdf ] Creating the global workqueue during driver init may fail, deal with it. Also, destroy the created workqueue on any subsequent error. Fixes: 0f54761d167f ("qeth: Support VEPA mode") Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/s390/net/qeth_core_main.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) --- a/drivers/s390/net/qeth_core_main.c +++ b/drivers/s390/net/qeth_core_main.c @@ -6544,10 +6544,14 @@ static int __init qeth_core_init(void) mutex_init(&qeth_mod_mutex); qeth_wq = create_singlethread_workqueue("qeth_wq"); + if (!qeth_wq) { + rc = -ENOMEM; + goto out_err; + } rc = qeth_register_dbf_views(); if (rc) - goto out_err; + goto dbf_err; qeth_core_root_dev = root_device_register("qeth"); rc = PTR_ERR_OR_ZERO(qeth_core_root_dev); if (rc) @@ -6584,6 +6588,8 @@ slab_err: root_device_unregister(qeth_core_root_dev); register_err: qeth_unregister_dbf_views(); +dbf_err: + destroy_workqueue(qeth_wq); out_err: pr_err("Initializing the qeth device driver failed\n"); return rc;