Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3530418pxj; Mon, 24 May 2021 08:46:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyU9jNgqW3iVH1RUOPra7shkOpIFNFVxGSlToSXb4tA6rVN4E+eqhAQBhjtUKWGtzNNhbeO X-Received: by 2002:a17:906:3ed0:: with SMTP id d16mr23548728ejj.16.1621871178930; Mon, 24 May 2021 08:46:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621871178; cv=none; d=google.com; s=arc-20160816; b=qWOh0MhOrh9eLPTxlHfhvI0z1lwxrWJEf7OfLjupfv6vPAKC6yJVFhUfyImh5bpc2H BRB58HiM1soUuorlPNnCaGkatdfq+M6AFT6XSplPBq9sekBCg8v+2dbm1aq48z1+knol 2h//ap1hzkwvQDFdMgDwUw7Vsv3WkvlC9JWbta1E6Kh4GTm45pdcy1NMhnSteeTDf2jK G/fKOiYPU+rQrMkPiv6c57KQqdTkklJz/LboEZnFfUUKSwh0iaW/ntaqjXbH/eL8D4LH ZLzMlc5U1hzfrGvs5otmDwkWo/YLLtglo9GkqHIz9iXZeMwQXfnz9xD0awJF+eCfe7Zd uXIg== 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=UaNWq+gJI1NCn87Qdn2Ks2oXC7KD436+MWAYVu1k3CWVkb7V2bvMRBftGtSUoivICL +aXHKu+43CwSQ2o7noXTy/FAScM6OSpRCUGl5cUDO0gJPqYLzKce/fHmTXqERo8fowgo SMwG4S4SXHJ3knXoCbNc/9xlCpqjLDULK7Hh6/sV1mjOLFxAJa57ZhuUWuqnNRGvqMzR KpWtCUTn3krDUmrJGU7x04PRDklbv094s5ILQv2ZTUcvOqAbD+n6xFyJJsFmO5JJVnCj rdpV9c4Mb8XZBIkaQ6BcrnR+9M2TPBaz5igOVcgMtBR2/gI/P5Em5NocGbaGPBGqfIyk F1qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HE7buHkB; 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 g18si12008279edb.157.2021.05.24.08.45.55; Mon, 24 May 2021 08:46: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=HE7buHkB; 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 S234467AbhEXPoU (ORCPT + 99 others); Mon, 24 May 2021 11:44:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:58038 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233583AbhEXPkQ (ORCPT ); Mon, 24 May 2021 11:40:16 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 52B6661430; Mon, 24 May 2021 15:34:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621870447; bh=gAC8X44v/DAW6Ft4kgj+eMny2o3mMGv0TRRVGZTyjj0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HE7buHkBWHXqeLH1rf5RLi01OMhbRIYkQFpBXsJvMXT58uOAcMaiLhGHWxl6MBDC+ QWKQrVi7L+wCkuVGwyClhL0cw6oogmR848olWQk+a6YgdUWFYYWn56qAN1XHpsOxJS qL+Gm8Yc/jiwAstDrR84T5ivhw+DvccNJ64okFZk= 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.14 11/37] Revert "rapidio: fix a NULL pointer dereference when create_workqueue() fails" Date: Mon, 24 May 2021 17:25:15 +0200 Message-Id: <20210524152324.576543251@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524152324.199089755@linuxfoundation.org> References: <20210524152324.199089755@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;