Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3524820pxj; Mon, 24 May 2021 08:38:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxXVpCT17JK3ivums1J2bIsXXsnb1q+AKL+GyQx789kF2xpArkHjh1Zwk1zrH/loTUtsdnB X-Received: by 2002:a6b:b48a:: with SMTP id d132mr16923549iof.167.1621870698025; Mon, 24 May 2021 08:38:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621870698; cv=none; d=google.com; s=arc-20160816; b=WRiLzWQNIkVWvS3jd5/FgpAhM+sXdCyP4l6rdtwr2/E+YT1XrzWsGmqMJ3situ26ZE F6Vv3Aml9HwPeZQpT7RKNxLWI4DX63A3KSAQPzUM3hZ6QV7D/YJErAB2AE0zQR6NPWT8 RAteeYnAYleLSYTOrNsCYEdm9tAS/XhxiEQ1Xg1PyFUKX/c5GhI6evFhx+tSeLJ0ckEn EftK9MP/eLITrhO+T4p6JVNbAdEmKAoYeTv74Bp5sZR4/DkVxUVeWmUh07wGknL7hec3 zDFDPsYP6DYf2dvX9eGZuGF2eUJdKCLITSCA087WampIkA/2CXobm8yPkFaBESj/iZde v2Lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=z8F3O7uoXRCDdsu9gklUb7a/q/so9LjMykkzPXAC/KU=; b=Vz6n4c/DdHOH3IdZrvYo1MeFb2kysH7Ghz0Y5B4oQ5EYUp8jEArHKkwFLvOWkiJps+ B6QGQlmRourQX9uTq+zeUJ/0OEAB4NwjzPT80eCm19s8RPTzMU6ZthPJBtA/jkoidBoC ie53aNSFwftBdBALOeIwrertK3SOOzkVD9yDsWJMqJea3+B6o4FeiWy3q1qBAOJFAFaV OJ7WsFxkZOL3JP2XXGLPokac+o08Lf7pheFYw3yen36UuHd8Biwkjhbe/FtL6J6R1OoO paVAs9kRtWCzcml86Wg4wkS9efEBiohX+pkYydE+WsvN3KsM2GWsnaqXbJM76FLsZC6v G6xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wF2OcdwJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f17si10423717ilc.44.2021.05.24.08.38.04; Mon, 24 May 2021 08:38:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wF2OcdwJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234051AbhEXPiX (ORCPT + 99 others); Mon, 24 May 2021 11:38:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:51512 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233594AbhEXPey (ORCPT ); Mon, 24 May 2021 11:34:54 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 43BA36138C; Mon, 24 May 2021 15:32:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621870333; bh=gAC8X44v/DAW6Ft4kgj+eMny2o3mMGv0TRRVGZTyjj0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wF2OcdwJRKEeCYzLXAqaW7KyjbQNknM1c2xxRdotG9GWfmK7ch73/lhiuha1+8Z6e eRCC0G4BBfpdZb2hQp5DejrMyA9tqheI+D2p717am7qPIkAOIyMaiKCk9WrijVBOAw 1PlaQdPIqhgNjcQfz7Lnk0E3Ng6Ng7CJ3g97pjLE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kangjie Lu , Alexandre Bounine , Matt Porter , Andrew Morton , Linus Torvalds Subject: [PATCH 4.9 10/36] Revert "rapidio: fix a NULL pointer dereference when create_workqueue() fails" Date: Mon, 24 May 2021 17:24:55 +0200 Message-Id: <20210524152324.501549476@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524152324.158146731@linuxfoundation.org> References: <20210524152324.158146731@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Greg Kroah-Hartman commit 5e68b86c7b7c059c0f0ec4bf8adabe63f84a61eb upstream. This reverts commit 23015b22e47c5409620b1726a677d69e5cd032ba. Because of recent interactions with developers from @umn.edu, all commits from them have been recently re-reviewed to ensure if they were correct or not. Upon review, this commit was found to be incorrect for the reasons below, so it must be reverted. It will be fixed up "correctly" in a later kernel change. The original commit has a memory leak on the error path here, it does not clean up everything properly. Cc: Kangjie Lu Cc: Alexandre Bounine Cc: Matt Porter Cc: Andrew Morton Cc: Linus Torvalds Fixes: 23015b22e47c ("rapidio: fix a NULL pointer dereference when create_workqueue() fails") Cc: stable Link: https://lore.kernel.org/r/20210503115736.2104747-45-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman --- drivers/rapidio/rio_cm.c | 8 -------- 1 file changed, 8 deletions(-) --- a/drivers/rapidio/rio_cm.c +++ b/drivers/rapidio/rio_cm.c @@ -2147,14 +2147,6 @@ static int riocm_add_mport(struct device mutex_init(&cm->rx_lock); riocm_rx_fill(cm, RIOCM_RX_RING_SIZE); cm->rx_wq = create_workqueue(DRV_NAME "/rxq"); - if (!cm->rx_wq) { - riocm_error("failed to allocate IBMBOX_%d on %s", - cmbox, mport->name); - rio_release_outb_mbox(mport, cmbox); - kfree(cm); - return -ENOMEM; - } - INIT_WORK(&cm->rx_work, rio_ibmsg_handler); cm->tx_slot = 0;