Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3547704pxj; Mon, 24 May 2021 09:07:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwZm0Ioo+DPdIYvGywANhpDydETBjBs7kn/hK/wklFIfQH5cb5EVIaTYHsYBELzCr6HqaVd X-Received: by 2002:a02:294d:: with SMTP id p74mr16430905jap.132.1621872431956; Mon, 24 May 2021 09:07:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621872431; cv=none; d=google.com; s=arc-20160816; b=GZ+UvtXU1a4OIqztcqgY4bF1Om8MS+0XX93o6J+bnlCdX8VOj38IuCPiLfx0d4r6Is oEITQVt8cBYxZe/HbG1QbN3ZOZvLBlpS12A90TBNpa0DMcFl0bRO5c2h9mb/wgfQQAUO 4s2IT80CmYdPhd4fsoIk+EcOFQdmnh52bNsug2bj0Hv0t7ySypgOKbA2e5c0WakgngCQ Apm6IDasSyE+70+9IIJ8jR/ZZtVtwZzN5AG2wpXJk+YCSh3FAnC1kusJYk85jCQzChNt 2U0puEDNg1x4r7qAeBeHmVrnSyBNQ/kUX8380GTl8vsHkv/+Zst0JwWeYmOF1EPlXj7C 8nTg== 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=MzcGEjU1Lw1lsrbHVSs2+5IDXTL7h81X6RWlSVW5WeI=; b=qiZ0ljmbijqe5XFkraifs0UHY4vuVt0xu6+G4J7H+Bo78ezFMmf8SR9dm+KbpscxY4 ZWWhLCIATyr29Zm8Pt5+9jsVaSwW3VkAuMo2LzjvWbiPA0aZ9TqEoUahuA4TErHnuDnJ meVr/J6GhesmxBOTkFuSrT+zG7bNkRvVGI8ex1XPaINnQNNlaHFqJuVxy0KZ6URI1Z1v BqOu1CL8uKNfN/KUBe12qGvOG8ia5I8AZcCpF8MhwJcuhU8zDllQLqJwtar1U02+r0z5 8jR1lkxBd2lXXz1TgLoUsH+HRlbIVpgMKkmwQ0RVUzja6IRtlZmHMXexhilRITamfZIw 2Q1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mXHGUMjA; 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 c15si13672549ilo.151.2021.05.24.09.06.59; Mon, 24 May 2021 09:07:11 -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=mXHGUMjA; 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 S237473AbhEXQH5 (ORCPT + 99 others); Mon, 24 May 2021 12:07:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:46806 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235903AbhEXQAM (ORCPT ); Mon, 24 May 2021 12:00:12 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 01BDE61466; Mon, 24 May 2021 15:45:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621871155; bh=xmY+4bwXyv8vXctWVn5P/aWg2p7VLhR8lJBTkBXgHBA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mXHGUMjArTwSRIVO4P3iMH2XeAEzoAy/NloFyOIrCpIQlP6PSCvcuV1m35wBSEVdK JAvAKgkZ3uiIFH6m6oQIkTD7gPNntybxphrFy845beArMsI8ObD+jyWqIseFDihFs1 s3l3ONdFE9ildan9xTMBOiCI+/1/Q1Z3R68FZEZw= 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 5.12 064/127] Revert "rapidio: fix a NULL pointer dereference when create_workqueue() fails" Date: Mon, 24 May 2021 17:26:21 +0200 Message-Id: <20210524152337.017313765@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524152334.857620285@linuxfoundation.org> References: <20210524152334.857620285@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(-) diff --git a/drivers/rapidio/rio_cm.c b/drivers/rapidio/rio_cm.c index 50ec53d67a4c..e6c16f04f2b4 100644 --- a/drivers/rapidio/rio_cm.c +++ b/drivers/rapidio/rio_cm.c @@ -2138,14 +2138,6 @@ static int riocm_add_mport(struct device *dev, 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; -- 2.31.1