Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp14975289rwb; Mon, 28 Nov 2022 06:49:58 -0800 (PST) X-Google-Smtp-Source: AA0mqf69n3O/vK8daiBTBOkVuqnjYysZ4lowwxmvNLVmnxoDB67Re1scsEb8jQUSc8x6zim0b90B X-Received: by 2002:a63:5254:0:b0:477:6195:34f8 with SMTP id s20-20020a635254000000b00477619534f8mr30738881pgl.286.1669646997764; Mon, 28 Nov 2022 06:49:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669646997; cv=none; d=google.com; s=arc-20160816; b=0oz76rEdOKFZ7AW/4RA9WGeUTM2y204klpaXsDnELo/Lq5F1SphCIdfDKrFcM+RY3e 4QagFVC/p21iVh9NOaSzSh7yJ7HKzlid064Lu+RH8uVuKq1zii+O7JES5Agv4HAXXoF/ b+nXnq8CiOEQtaav/ME5OUbGSQF4KyX7+v3SPlbri0oEAInO7Mw5/OsOz5kKJq/TJ7gr tjU3x5Bp+o1nhOnIlcuKLsfA+lAJnr+pPwd+EdhcHFjuokihZrrqaozqPjjCnFdsAht2 YVaFmvOx9RUE1RSomSSulFKqjxR/V7dg+IGoQUpyLxlukrPtVocjEinugKaCVTjnpy6i 60ag== 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=uwypJt2pbpSnqaKUhdNDX85hjjGPSY5lq4no+chAH5o=; b=MST8WXu1yZY03FAyebSJcziQT1ooq4iqb8I2+UrwIAJrbYHhua7jN2NUYBGZgxmbbp 68S13bbYCBtEM30MwujxPBcshw1EjpkpZ6ZHKnjBzC4yh9ljLaRw61h2MNVySe0qF25P Q4DnVBVzZJDyUT+3/4w2ItSJRAxlsdYGOtRs3HlvwSVIjxaUS4vdqMMo9c3SyOW6oNLv goleC31b0Z82ViR5+Pov85GXYxu6zB3Why0BvCRanhq1Lw6YjQfQdDQk9WH7wTvTqU1g XInV/fHQGx/55wSaIHYXWu8uycEXz1+TyyYKM7MTaUqHhPxe6cNmm63c6sun/ybqcHge d3wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qul9P9ds; 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 d8-20020a170902cec800b0018701f083b1si13417697plg.619.2022.11.28.06.49.46; Mon, 28 Nov 2022 06:49:57 -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=qul9P9ds; 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 S229764AbiK1OrQ (ORCPT + 84 others); Mon, 28 Nov 2022 09:47:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231268AbiK1Oq2 (ORCPT ); Mon, 28 Nov 2022 09:46:28 -0500 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB85024BCD for ; Mon, 28 Nov 2022 06:45:58 -0800 (PST) Received: by mail-pj1-x102a.google.com with SMTP id t11-20020a17090a024b00b0021932afece4so3305981pje.5 for ; Mon, 28 Nov 2022 06:45:58 -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=uwypJt2pbpSnqaKUhdNDX85hjjGPSY5lq4no+chAH5o=; b=qul9P9dsfRtS9FnYBq7V5iw0GxgW7CKYp54Fy3P1Vk5Nd2VET1yvFKB0J+Ar/sj//c CD2Q2M/ILzO0aHzSLAVgJLkX3h1mPjjXLKT1CIVMKN93jPC17JZFH0Kbr05F4zGEsvCP /mEAkd/g13Zc2Q0+cowFCVQ7ZNVXt8bOoCzrj5fY4QMwUBRwCTuHuMMDrCidjpbhe2YY 5Yj62W2dcuZ6qd4h2EutIP8ajhZQsjHulo1pwwZpdgzaQM/U0gDVkWfPOvXiMbx1gnnC x9LqCYKW60nKernwO701tWvnQvUH+3jwIrvqAkKsxkSkpRtvCBk/GG6VSNGoOOatYZ31 QKNQ== 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=uwypJt2pbpSnqaKUhdNDX85hjjGPSY5lq4no+chAH5o=; b=5AxGHaHS7O+rOnWuYqMqqXAf1jm98ywUFDaT4RRn8w1Kpf65kgIOiFh6VgHpIGUfbl Rw2oksy6XBlLIRElvMqArpMuxdh2ja/NTWoNQVRnf8p0GkmOx/tYTkHRv5hWOuoYJZyd uFWJg0D4Ak8PlPOdpVi/extbORRCEddyqpUywGGKWQkCBqbxcAgAW4pdfXssV8c2Q8bR apD0Mj5DU9yGkHAnHBXp3B8Ck+j0fXnTQAHizkqyEQ4stjqs0txjUN4DtF8ia0s+9zpx ZpxzHJ+RJ8FB+u0NJ5KB989KxyMtG7pHkdOytHH8EiPujc0t8+dXY3r1sT4HAoiRNRNa WmXQ== X-Gm-Message-State: ANoB5pmi7XCAWVWDoks3ydN3xg1HDt94pMZDF0xzHwN0Fs+0pnwbNAHX LT/jez1erPxOloBzvVC08S2gHjQ78Sb34qUB1pTFLA== X-Received: by 2002:a17:90a:ae0f:b0:20d:b124:33b1 with SMTP id t15-20020a17090aae0f00b0020db12433b1mr53464933pjq.202.1669646758244; Mon, 28 Nov 2022 06:45:58 -0800 (PST) MIME-Version: 1.0 References: <20221126012558.34374-1-jiasheng@iscas.ac.cn> In-Reply-To: From: Ulf Hansson Date: Mon, 28 Nov 2022 15:45:21 +0100 Message-ID: Subject: Re: [PATCH v2] memstick/ms_block: Add check for alloc_ordered_workqueue To: Dan Carpenter Cc: Jiasheng Jiang , 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=ham 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 Sat, 26 Nov 2022 at 09:01, Dan Carpenter wrote: > > On Sat, Nov 26, 2022 at 09:25:58AM +0800, Jiasheng Jiang wrote: > > As the alloc_ordered_workqueue may return NULL pointer, > > it should be better to add check for the return > > value. > > Moreover, the msb->io_queue should be freed if error occurs later. > > > > Fixes: 0ab30494bc4f ("memstick: add support for legacy memorysticks") > > Signed-off-by: Jiasheng Jiang > > --- > > Changelog: > > > > v1 -> v2: > > > > 1. Assign error number to rc if alloc_ordered_workqueue fails. > > 2. Free msb->io_queue if error occurs later. > > --- > > My other question about this driver, not really directed to you but to > anyone on the list is where the final destroy_workqueue(msb->io_queue) > is when we unload the driver. Good point, it's simply missing somewhere in the path of the ->remove() callback. Kind regards Uffe