Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp7324717pxb; Thu, 18 Feb 2021 07:17:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJxo23dmyoO3r90ESaS+DXON8eW24x6+Fe30ZjhcSGeqfGhcd8HIw5qMy8XpoLCfu0q4/y+L X-Received: by 2002:aa7:d315:: with SMTP id p21mr3019286edq.300.1613661425456; Thu, 18 Feb 2021 07:17:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613661425; cv=none; d=google.com; s=arc-20160816; b=Vkj7krSvCnAPKjVf7abav+xtMLL2yGsHqrsXbLRsYlazrtjHI2GQfwg283dEjxGvLa wuXGc53rrPYSDFZxoU/3yyDjrFje2JFxDHv0VI2gqkrUi5V3XyZqdStXlyxkpHhoY5u0 Im/bre+/TXUeJC2R50pdpT+sXyYhuLLq4WJes9VyxzdDL8UwXZq81WOjoZiBCkXHIM30 Zq5Ixuek0qVlX+1m4sUCuwCuX+r0QOwVIneY+hEjngMfPvFBGcZP2X/MYnRQKGTnymFF Yn3ynzYovDjlltgd2waihSg8WxZmnp5gz+845Hv1c+omakXYZhUclJb00Hxl1EIeY6KN R91Q== 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 :message-id:date:subject:cc:to:from; bh=IKIaQ6ELrGgwCnTlMXXneg1+rxr6n+HDZBSP0Bjl/kc=; b=AgAw02UiDf41ku8YP/LfzIbZl+DdO5hbL0/KBwwk5B+5DLXuBZwiMaJ2a7SAteTNQg 2p7sqsjQDHUcP+S1B6/2yFi3/mRHdyQ0UQVtLiYpjv1LdZk3pnBuSlcDtHoOHL40+eiQ RqCV4sv5WXOm1NilYWjqieQyqbNGCk4mu5aKBrQ9Oi5wN9vNKRa8l45ZgD7Xf8stkEQy +ZrBL7OmZNja5Vfd57IDYrOR9NKQdpcNvZdejb/SNl2c4wJhk16vKNgC0hhr1OcCfYN9 dWMTyHAgVqWXcIZu+EftVWhbZ1Y+B8e7gzqnY2TUh90omxYUrtIGusbE5RxqShWxMdKy BIRQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a11si3771870edn.318.2021.02.18.07.16.41; Thu, 18 Feb 2021 07:17:05 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231349AbhBRPPh (ORCPT + 99 others); Thu, 18 Feb 2021 10:15:37 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:12978 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232677AbhBRMXt (ORCPT ); Thu, 18 Feb 2021 07:23:49 -0500 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4DhDL91s8kzjPKQ; Thu, 18 Feb 2021 20:20:01 +0800 (CST) Received: from huawei.com (10.175.101.6) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.498.0; Thu, 18 Feb 2021 20:21:22 +0800 From: Sun Ke To: , , CC: , , , Subject: [PATCH v6 0/2] fix a NULL pointer bug and simplify the code Date: Thu, 18 Feb 2021 07:26:18 -0500 Message-ID: <20210218122620.228375-1-sunke32@huawei.com> X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.175.101.6] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org fix a NULL pointer bug and simplify the code v6: Just add if (nbd->recv_workq) to nbd_disconnect_and_put(). v5: Adjust the title and add “Suggested-by”. v4: Share exception handling code for if branches and move put_nbd adjustment to a separate patch. v3: Do not use unlock and add put_nbd. v2: Use jump target unlock. Sun Ke (2): nbd: Fix NULL pointer in flush_workqueue nbd: share nbd_put and return by goto put_nbd drivers/block/nbd.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) -- 2.25.4