From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 05C70C48BDF for ; Thu, 24 Jun 2021 10:11:50 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C3E1A613F9 for ; Thu, 24 Jun 2021 10:11:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C3E1A613F9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=8zgAJh9YQ44a+A6GMwQlA+ZQO5cmfy1gxoRdj/hsA2s=; b=sHC3IhnHaVkyZ0 0zKbvVeXZzlqZ2i0bXPYk8qwKBTN9SA8ZNmtoTtR0aN6CCiWjMguNkv11U8bi8rPTa/WE2wh0BdhF 82M1S95YMnFE7jhVb5lkauGb71fmzFO/QCvTlxG+4UHhyWbSxYUbVLmhJn90k4hDguSdWaJTg9FuA R4cMqlnhzx7ni32BvXoT8++MSLVnWVUO7aIbFKOixFEW4dUDLSkdoruU1y/wGXf3nqjOQ0Iw1iUAY w+LEiqeOAzzPz/fXEoLb7zdPV1nnHcsEkAfpCINEJNvb7R+x5s67jgIwhSKkGrVH/By1WhrZ9PUA1 cju1sfJjt/qnj8eojUPw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lwMJ5-00Dwpx-HJ; Thu, 24 Jun 2021 10:10:00 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lwMI6-00DwV5-FH for linux-arm-kernel@lists.infradead.org; Thu, 24 Jun 2021 10:09:00 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9A42731B; Thu, 24 Jun 2021 03:08:57 -0700 (PDT) Received: from e120937-lin (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 03BC33F718; Thu, 24 Jun 2021 03:08:56 -0700 (PDT) Date: Thu, 24 Jun 2021 11:08:50 +0100 From: Cristian Marussi To: Sudeep Holla Cc: linux-arm-kernel@lists.infradead.org, Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= Subject: Re: [PATCH 2/2] firmware: arm_scmi: Ensure drivers provide a probe function Message-ID: <20210624100850.GB40942@e120937-lin> References: <20210624095059.4010157-1-sudeep.holla@arm.com> <20210624095059.4010157-2-sudeep.holla@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210624095059.4010157-2-sudeep.holla@arm.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210624_030858_759147_CAB460E8 X-CRM114-Status: GOOD ( 14.93 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi, On Thu, Jun 24, 2021 at 10:50:59AM +0100, Sudeep Holla wrote: > The bus probe callback calls the driver callback without further > checking. Better be safe than sorry and refuse registration of a driver > without a probe function to prevent a NULL pointer exception. > = > Fixes: 933c504424a2 ("firmware: arm_scmi: add scmi protocol bus to enumer= ate protocol devices") > Reported-by: Uwe Kleine-K=F6nig > Signed-off-by: Sudeep Holla > --- > drivers/firmware/arm_scmi/bus.c | 3 +++ > 1 file changed, 3 insertions(+) > = > diff --git a/drivers/firmware/arm_scmi/bus.c b/drivers/firmware/arm_scmi/= bus.c > index dc113ad37ad9..6c7e24935eca 100644 > --- a/drivers/firmware/arm_scmi/bus.c > +++ b/drivers/firmware/arm_scmi/bus.c > @@ -134,6 +134,9 @@ int scmi_driver_register(struct scmi_driver *driver, = struct module *owner, > { > int retval; > = > + if (!driver->probe) > + return -EINVAL; > + > retval =3D scmi_protocol_device_request(driver->id_table); > if (retval) > return retval; Reviewed-by: Cristian Marussi Tested-by: Cristian Marussi Thanks, Cristian > -- = > 2.25.1 > = _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel