From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760324AbdLRUG1 (ORCPT ); Mon, 18 Dec 2017 15:06:27 -0500 Received: from mail-wm0-f45.google.com ([74.125.82.45]:38430 "EHLO mail-wm0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756931AbdLRUGV (ORCPT ); Mon, 18 Dec 2017 15:06:21 -0500 X-Google-Smtp-Source: ACJfBosQN3AcHPNVEi92BxVsjFi5AIB22AGA3bUNzyWISK8/9jG2MA9CE0JUlJE3m+m3fXS1/VhnVA== Message-ID: <1513627578.29566.6.camel@baylibre.com> Subject: Re: [PATCH] clk: check ops pointer on clock register From: Jerome Brunet To: Stephen Boyd Cc: Michael Turquette , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Date: Mon, 18 Dec 2017 21:06:18 +0100 In-Reply-To: <20171218190303.GV7997@codeaurora.org> References: <20171218170007.28042-1-jbrunet@baylibre.com> <20171218190303.GV7997@codeaurora.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.2 (3.26.2-1.fc27) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2017-12-18 at 11:03 -0800, Stephen Boyd wrote: > On 12/18, Jerome Brunet wrote: > > Nothing really prevents a provider from (trying to) register a clock > > without providing the clock ops structure. > > > > We do check the individual fields before using them, but not the > > structure pointer itself. This may have the usual nasty consequences when > > the pointer is dereferenced, mostly likely when checking one the field > > during the initialization. > > Yes, that nasty consequence should be a kernel oops, Precisely > and the > developer should notice that before submitting the driver for > inclusion. Agreed. But people may make mistakes, which is why (at least partly) we do checks, isn't it ? > I don't think we really care to return an error here > if this happens. > I don't understand why we would let a oops happen when can catch the error properly ?