From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754960AbcKBAWc (ORCPT ); Tue, 1 Nov 2016 20:22:32 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:57346 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753455AbcKBAWa (ORCPT ); Tue, 1 Nov 2016 20:22:30 -0400 DMARC-Filter: OpenDMARC Filter v1.3.1 smtp.codeaurora.org 8CC446134E Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=pass smtp.mailfrom=sboyd@codeaurora.org Date: Tue, 1 Nov 2016 17:22:29 -0700 From: Stephen Boyd To: Christophe JAILLET Cc: lars@metafoo.de, dan.carpenter@oracle.com, ssantosh@kernel.org, mturquette@baylibre.com, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH 1/3] clk: keystone: Fix an error checking Message-ID: <20161102002228.GC16026@codeaurora.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/24, Christophe JAILLET wrote: > clk_register_pll() can return ERR_PTR(-ENOMEM) so checking the return value > against NULL only is not correct. The code just doesn't propagate the error up to the caller. Instead the caller treats NULL as an error and non-NULL as valid. If the callee detects an error it hides it and returns NULL. > In order to fix it, update clk_register_pll() to always return an error > pointer in case of error and check the return value with IS_ERR. > > While at it, also fix a tab vs space in the surrounding code. > > Signed-off-by: Christophe JAILLET > --- > Un-compiled and un-tested. Please at least compile test patches. -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project