Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6051943rwb; Tue, 22 Nov 2022 08:10:49 -0800 (PST) X-Google-Smtp-Source: AA0mqf7rXitx/4GMd1F8as6PWj1cA8kt/zAEAW+uwOlJZN+m6svz2uSZCQbvn5zzQKNq8XBoCRt3 X-Received: by 2002:a62:542:0:b0:56c:45db:4481 with SMTP id 63-20020a620542000000b0056c45db4481mr25883900pff.86.1669133449206; Tue, 22 Nov 2022 08:10:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669133449; cv=none; d=google.com; s=arc-20160816; b=Z6amI8aR+51hDjYIMrn9HT7TSNfcsdL8WMh8CTCjeh4tWPxOdBCTiC1jkKxoDyus9y QVz+23e74YvZUAWNgUMm2tqiyBgJWjgqYIi7zJtMj+BD6w8bG9FqWfiO51sN46JPbtrJ vsa8YuBRmVEy8P9KdOf/82fbXakfvP+VRcY7HUvY90A+li0uWKEZamGeU7CFgL5HxMOW HwcdFi2NbYAx/Xt4KqrRmx5j+IcqW2+Q+XhHLV2H7qzNiJ+iXAL9heanYKR+Lb3y2Ufn 3JYPb3oP4vYD5XYW+sKXYXty8Ejr4JJrUYW/NJSIFECdlR1FYjScgLbgWk1EIGzifHNR gOYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=//83h2K3ZLQK+/apVRAjIhcjjf8VIwpKCeqeGKpSWZY=; b=KzwjxhjE5G3mugzPx4ruyFl94Jpazt5hSJd/9Z/upgwaWTOG3lIbew10BPXvHA0ksm TWIgadpiNT+1G8lw5komVzBjyZm6j/+/weKv6v5sLQg9Gng0+g6zvwXeSs9jSV94cuw4 ApQ1Xsb05frQ6qh60aBEazyNfDjvXI4RFk1ULCg1MDkOvVM/NBqBVouPy/3kbpbSpMzk WfHzp258MnL7i9svZq5TaG/r7x3lE+6Fr15umnJpJZPV8lhrMSTMlVKLhSQRzGxz/1sh 4Q8cLXbH8ObOl4X6BrTPfm1+eDDzAZWll704RgaLCHeSXOQnX0/hoK2sgvIWjB/mlllk 11zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mQ2TPmCm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bd32-20020a056a0027a000b00573a320155fsi6900712pfb.34.2022.11.22.08.10.37; Tue, 22 Nov 2022 08:10:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mQ2TPmCm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234052AbiKVPpV (ORCPT + 91 others); Tue, 22 Nov 2022 10:45:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234020AbiKVPpL (ORCPT ); Tue, 22 Nov 2022 10:45:11 -0500 Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9136C71F07 for ; Tue, 22 Nov 2022 07:45:10 -0800 (PST) Received: by mail-pj1-x1036.google.com with SMTP id o5-20020a17090a678500b00218cd5a21c9so2268339pjj.4 for ; Tue, 22 Nov 2022 07:45:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=//83h2K3ZLQK+/apVRAjIhcjjf8VIwpKCeqeGKpSWZY=; b=mQ2TPmCmbeO2oEaUGOMCR5p6U+FvYLrqFxv1UfblbK31Cjk86Dzj1VRFW+3xgXHSee P1iLErDVURrom5YmlKKy5Hm5wUNJuwAxdKKSZLiJnuLLMyoQrIAkaIhNr/8x1+/B8sBz oL51ArMvrbICSV77LjYGc3nw8fBKl1m9BV5HBQC5j8X9kz1DANWKAKGYAPRQFkS+u0/q 4m8jjWpMQi6E7XrVg/L5rGfQRM1UUfLElnsqQHWJt5X4MDL2wY1mHfeh7/YXXi0v26wu XYbXCaYKN1fvJT1RejRoqjjRTU3GwBweHDl21IiCEJucEIFUfTqT92ZO7H6DuqWXlBtx qNfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=//83h2K3ZLQK+/apVRAjIhcjjf8VIwpKCeqeGKpSWZY=; b=DOy6YSr4ftku3OV5iGpKjiXyO377D+hmnYmtSu3rdiGTULkf+1GSboK/7DlLF5ww// du9w7zN7B/Fwcbr7lHH+ccnJqqO9SyGeAYQ/iXIcUUcqLzGUCOevta36HPneyzVzBwb5 aChsvQ6PR6cPTfzgMJon0m5fzS5O9ujt0hXJcJOs9M6Iol32pxP/DWke56XFaKWvy8R3 nT6QSdRhCttluQncFM2Xv4hxf9bHcMHhpKKJqZaM1vRS3iB745UkPxNZHRnujs4rPNiw 9T0AzWfGDnTeeRUioIyFQ2BF5+06HRc/b241gLUrDIIMlhfAfCv9INGYxUK9bYHcOB/i /yRQ== X-Gm-Message-State: ANoB5pmJzev/yrNi7iAdZFULYAKkp6MUtOWPeB5tC6eOWHK575Ah2UYy /f1lrBaB8gN+s6Yg6HLdzZYwmrVausOhk5ruU2JYlg== X-Received: by 2002:a17:902:d68b:b0:188:cca8:df29 with SMTP id v11-20020a170902d68b00b00188cca8df29mr10491383ply.148.1669131910075; Tue, 22 Nov 2022 07:45:10 -0800 (PST) MIME-Version: 1.0 References: <20221122091856.47606-1-jiasheng@iscas.ac.cn> In-Reply-To: <20221122091856.47606-1-jiasheng@iscas.ac.cn> From: Ulf Hansson Date: Tue, 22 Nov 2022 16:44:34 +0100 Message-ID: Subject: Re: [PATCH] memstick/ms_block: Add check for alloc_ordered_workqueue To: Jiasheng Jiang Cc: maximlevitsky@gmail.com, oakad@yahoo.com, christophe.jaillet@wanadoo.fr, axboe@kernel.dk, hare@suse.de, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 22 Nov 2022 at 10:19, Jiasheng Jiang wrote: > > As the alloc_ordered_workqueue may return NULL pointer, > it should be better to add check for the return > value. > > Fixes: 0ab30494bc4f ("memstick: add support for legacy memorysticks") > Signed-off-by: Jiasheng Jiang Applied for next, thanks! Kind regards Uffe > --- > drivers/memstick/core/ms_block.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/memstick/core/ms_block.c b/drivers/memstick/core/ms_block.c > index ba8414519515..ccfdb3dea30a 100644 > --- a/drivers/memstick/core/ms_block.c > +++ b/drivers/memstick/core/ms_block.c > @@ -2116,6 +2116,9 @@ static int msb_init_disk(struct memstick_dev *card) > dbg("Set total disk size to %lu sectors", capacity); > > msb->io_queue = alloc_ordered_workqueue("ms_block", WQ_MEM_RECLAIM); > + if (!msb->io_queue) > + goto out_cleanup_disk; > + > INIT_WORK(&msb->io_work, msb_io_work); > sg_init_table(msb->prealloc_sg, MS_BLOCK_MAX_SEGS+1); > > -- > 2.25.1 >