Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2492818pxb; Mon, 18 Jan 2021 21:05:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJzez9xWusmUtALnlPc5YkEYJFyjIt3fCbF4rQXkTqB2LBuJG6pZ6+hiXMv0wS965cfKMc5Z X-Received: by 2002:a50:8d89:: with SMTP id r9mr1945486edh.144.1611032736482; Mon, 18 Jan 2021 21:05:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611032736; cv=none; d=google.com; s=arc-20160816; b=ToULeD49xBvMdLq9s9qrTyJ9jaKJEFYAUtWJ5ovLlhZVKnMVT1YoPBkoWezgdcLIdX 4pAZdP3Lqqsnhdyr8n0lTrp6iOU5CHQ9AYDq0It+WhxDcfzASleB1F2+O0lPt8CxkDXB aFbv4bv2qQUpaWrCmwVQI7s7ULqV4yF8en9SdK5cYudjXf/t5WPoGL1xj6YswM1D6bHn ASdQKIgzzrYYgp/oQ07/p0Hb2sIqlKXl8P0WdUyfNj+w4KIBkO6m1bpchP8mWnXlsEzr wWDmrE8Mg6ekXWE2S6KDtQJg2WH41K9vdeex06aJJkgZ9pbgBrqWK0OHU1z4H1fUpYs/ Kh8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :to:subject; bh=OthmH7/VJmg1YwRa1vVEop80hTr5oB7IPiqhI4YeeU4=; b=Pqakcjuk+YWVrjy4wYvMlSBFUIupIvFvL5QSo0i09pAK0/KtV/Z4ySJzgeXHogO6YO ubt8iMUcclBEGFfGVmXSf9Wd6iYEkUN6PM5HCJjfo2uULn+qbFUB7YYpNSgKzXUsWf5H TmUOs6OrfJGYfW4Qr8FdT8aztVYxbG9lCQFE1Ec8SNeW9uoUxUgALc2QTZdDVlSda+q4 f2BcsI3Pk4qbfl3ivU2xiNz2sMQfhYMj7W9aGzwzAd7yphbCA1tMdMn1xd+b3KvB8CVI /XS/pXsfemKqZ99N7T3ZUZo/oiVg/XX+fBNAijlH/VmCmsJ4h5wa+Sh26B1lVvwJkXyZ 7xNg== 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 v4si9455136edi.191.2021.01.18.21.05.13; Mon, 18 Jan 2021 21:05:36 -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 S2407522AbhARStN (ORCPT + 99 others); Mon, 18 Jan 2021 13:49:13 -0500 Received: from outpost1.zedat.fu-berlin.de ([130.133.4.66]:59337 "EHLO outpost1.zedat.fu-berlin.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2393782AbhARStJ (ORCPT ); Mon, 18 Jan 2021 13:49:09 -0500 Received: from inpost2.zedat.fu-berlin.de ([130.133.4.69]) by outpost.zedat.fu-berlin.de (Exim 4.94) with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (envelope-from ) id 1l1ZYX-001WqZ-Nn; Mon, 18 Jan 2021 19:47:13 +0100 Received: from p5b13a61e.dip0.t-ipconnect.de ([91.19.166.30] helo=[192.168.178.139]) by inpost2.zedat.fu-berlin.de (Exim 4.94) with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (envelope-from ) id 1l1ZYX-001ViE-05; Mon, 18 Jan 2021 19:47:13 +0100 Subject: Re: [PATCH] maple: fix wrong return value of maple_bus_init(). To: Lu Wei , dalias@libc.org, lethal@linux-sh.org, adrian@mcmen.demon.co.uk, linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org References: <20201126024311.292908-1-luwei32@huawei.com> From: John Paul Adrian Glaubitz Message-ID: <2fd68783-c1c3-7218-c83e-2f15a207ede0@physik.fu-berlin.de> Date: Mon, 18 Jan 2021 19:47:12 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20201126024311.292908-1-luwei32@huawei.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Original-Sender: glaubitz@physik.fu-berlin.de X-Originating-IP: 91.19.166.30 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/26/20 3:43 AM, Lu Wei wrote: > If KMEM_CACHE or maple_alloc_dev failed, the maple_bus_init() will return 0 > rather than error, because the retval is not changed after KMEM_CACHE or > maple_alloc_dev failed. > > Fixes: 17be2d2b1c33 ("sh: Add maple bus support for the SEGA Dreamcast.") > Reported-by: Hulk Robot > Signed-off-by: Lu Wei > --- > drivers/sh/maple/maple.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/sh/maple/maple.c b/drivers/sh/maple/maple.c > index e5d7fb81ad66..44a931d41a13 100644 > --- a/drivers/sh/maple/maple.c > +++ b/drivers/sh/maple/maple.c > @@ -835,8 +835,10 @@ static int __init maple_bus_init(void) > > maple_queue_cache = KMEM_CACHE(maple_buffer, SLAB_HWCACHE_ALIGN); > > - if (!maple_queue_cache) > + if (!maple_queue_cache) { > + retval = -ENOMEM; > goto cleanup_bothirqs; > + } > > INIT_LIST_HEAD(&maple_waitq); > INIT_LIST_HEAD(&maple_sentq); > @@ -849,6 +851,7 @@ static int __init maple_bus_init(void) > if (!mdev[i]) { > while (i-- > 0) > maple_free_dev(mdev[i]); > + retval = -ENOMEM; > goto cleanup_cache; > } > baseunits[i] = mdev[i]; > Acked-by: John Paul Adrian Glaubitz -- .''`. John Paul Adrian Glaubitz : :' : Debian Developer - glaubitz@debian.org `. `' Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913