Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3541064pxj; Mon, 24 May 2021 09:00:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxFJt2G5R/wr925OY6BBlhBmv5iP5eQ4osBKNgr7Nn38VvQkN6c/yvokmKcf05Lt4Dbi8Ia X-Received: by 2002:a05:6e02:1302:: with SMTP id g2mr16050793ilr.259.1621872033497; Mon, 24 May 2021 09:00:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621872033; cv=none; d=google.com; s=arc-20160816; b=lBpXMt63bspIbgyJ9LMR2wOfwgdGPRHeEsqmFtmDjLZMWVYywYbLwvVLtYKg+wGBsP EW26jOP2x5Uw6Ec2Nd20p5+NxogD1Ruq0tMMvh5zp1vJd4kekg6ezWTuRmIqHmB/cg8m uihVz4fEoS2HyPvrfWf6Ns6S6kU79I1hxX47n8BXuzqOIuWGAtlT7tW9hY6bq2VkFduW 9T6bZBj4viBrBrbrY+WnVf1NP+ZfMjF9e84wseHLDNC47TemSOL9Bau0vgHKdzV4U2zf k8NOYOfPUQouvh6+TSFdQR3VnZdwp3woZDOQO4AZHGAJKpl7m4ihqQdHcXwc5fdqUo81 6lXQ== 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=DH5hmL4njhzmyHEaJF5afLjdH96o8iTnPTQuCxq027Q=; b=dd2j+faTmA9QVnL1hOxa4Hb7iEYY3uHiUGF4rFubWIGT294z4HwxHIew+5eBuJ8hNu BtjSKdI91iZP6JQk+tuh9OzqijXdFxcyVIpXC5CC4RxfbiB74wGl6x9L2FIZLgCFN3UC LhXTmuT/bK2YSkIX34OVeJnCt3+FQPltW8OLzttv8PcJ/3qWEFoltmRvkqoA6h7qdXsg HQxS/QOlylhXI6QSDGOUrRNmF+ksnzdSTSShCKTSev/3Q1NWQkYerxBy703JgU314+gw BnNo6aA6v3qDOxcaH8xydV6dCrYCyKxGR7fQu1sxWft5H1NPN7RMTfnGb7tAvTStCJTS Y66w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BzkHvzJq; 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 l1si15296634ilg.123.2021.05.24.09.00.19; Mon, 24 May 2021 09:00:33 -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=BzkHvzJq; 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 S235679AbhEXQAE (ORCPT + 99 others); Mon, 24 May 2021 12:00:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:40492 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235304AbhEXPzF (ORCPT ); Mon, 24 May 2021 11:55:05 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CBED16192B; Mon, 24 May 2021 15:41:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621870862; bh=C+lh8KxiIEcHRnF8UVTrCETUejZU7TtyF3yTbjfQ5UQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BzkHvzJqljwb4d3r6LTGHh3OsQ3GJzhi/Cwj2fnZ5Wraumj9dshkSbrZ2lrtttfWa TeR7bzn0zYdgW015+RgadeaZE0/EhKL/2tEmvMG+zMeQa4TVsr9TrHNRW7/ertwrMc KyQDBkRDfDtJiHnhypaz8Fr6UUv8Snm6LVykIEn0= 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.10 051/104] Revert "rapidio: fix a NULL pointer dereference when create_workqueue() fails" Date: Mon, 24 May 2021 17:25:46 +0200 Message-Id: <20210524152334.535265782@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524152332.844251980@linuxfoundation.org> References: <20210524152332.844251980@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 @@ -2138,14 +2138,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;