Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3535316pxj; Mon, 24 May 2021 08:52:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJypBI1rheqceGodoiYq9eD1mN/R2dns5hbPs0yZ4nsQpx0kY1+GjfKTi2kqfGvW3zD9gN5H X-Received: by 2002:aa7:cd16:: with SMTP id b22mr12844315edw.108.1621871571110; Mon, 24 May 2021 08:52:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621871571; cv=none; d=google.com; s=arc-20160816; b=JtFc0uZiErCGShf3BxXDbmO1o62dTxFGj/v9UH4MXKkL+WDPlBgi9BObm7i9xbibVE /pOs039cd54bOJ2O0OIXf/H8s2a5BKzLOb3/XNFVTyDIjNDM8iIcNww3b4OH5EVxGYo5 NFvDX2fe/wZK28eDiCtCSh01AE4pAHUpIVA4rijRSN7WlPXy/bEdsH7soCFeQkMrNw7s 17wTlf5Mmya4OCxUgFukf2SYaNHoz6C8tI1dHY5MUL7X4W67RiqD/qqHc0Oxqutan7Bi syoG6tWy2YShjLmpCUX0HvlD/RGFA+/C4GwYmuQK10M9yFn7iPrN7G+piKdsZWz901lh h4Ng== 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=tn+Q96WR0WAxvCDK43xPGa0n99E6GxiEcY8run7VI/gGhP6twm7Llfm0OubgsUnppn XlMrn5rqKWT3dO5N088ZkPZ/yI+GalI/r05q00iUhD2biGhG7942Wqi3QDD+te1zPcAL J6ZXkxqqAe9TvqU7g8PgJ04V59uqBmWQNmZ5aLBL24o4H43GILS8Q66nVbUwqIhemeGP hJqiT8ey1H2N5daY2xCxtXT/VoYFCh7Luak3y8jdi6+QyVmxsa9q003NKZyb4DsWNEQS bcemVmfkwxZKKxp35LAiyPtt4vbNb3+NVn9BNLkjRr5GHaD3svzi8KVaLKTCaWdEkcmx cqFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=s0MlzwXx; 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 t6si11673514edd.419.2021.05.24.08.52.28; Mon, 24 May 2021 08:52:51 -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=s0MlzwXx; 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 S234623AbhEXPtR (ORCPT + 99 others); Mon, 24 May 2021 11:49:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:58132 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234325AbhEXPoF (ORCPT ); Mon, 24 May 2021 11:44:05 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7198F61454; Mon, 24 May 2021 15:35:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621870540; bh=gAC8X44v/DAW6Ft4kgj+eMny2o3mMGv0TRRVGZTyjj0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=s0MlzwXxvyFjEgvJ2PRqTaB5nrIFyiroMQOMcZeRo3M98TBpSdD5QvHwRW9q6b/I2 5IvW72e9yy7odDcYgwEHqta9qZjXKvYf/O9Yt2FFYtXxG1xUdF3ZJLtXsYWyPTJk/m I741W9N7rV3HuQjb226lzXpUlTbXkw1X6MwKktXo= 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.19 19/49] Revert "rapidio: fix a NULL pointer dereference when create_workqueue() fails" Date: Mon, 24 May 2021 17:25:30 +0200 Message-Id: <20210524152325.004146485@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524152324.382084875@linuxfoundation.org> References: <20210524152324.382084875@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;