From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752950AbbHTPxE (ORCPT ); Thu, 20 Aug 2015 11:53:04 -0400 Received: from mail-pa0-f46.google.com ([209.85.220.46]:34921 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752028AbbHTPxC (ORCPT ); Thu, 20 Aug 2015 11:53:02 -0400 Date: Thu, 20 Aug 2015 21:22:57 +0530 From: Viresh Kumar To: Arnd Bergmann Cc: linaro-kernel@lists.linaro.org, broonie@kernel.org, Liam Girdwood , "open list:VOLTAGE AND CURRENT REGULATOR FRAMEWORK" Subject: Re: [PATCH] regulator: core: Use IS_ERR_OR_NULL() Message-ID: <20150820155257.GB4159@linux> References: <3608f46110fb5b66e4e94f18a9af3283d4149fe8.1439794825.git.viresh.kumar@linaro.org> <1600359.hvYhnkmyof@wuerfel> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1600359.hvYhnkmyof@wuerfel> 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 20-08-15, 15:26, Arnd Bergmann wrote: > The use of IS_ERR_OR_NULL is almost always a bug (as is the open-coded > equivalent). > Please try to find out why this is done here and add a comment > if it's actually correct, or fix it if not. > > My guess is that it is not ok to pass an error pointer as the argument > of _regulator_put(), so maybe there should be WARN_ON()? I agree, but updating that would require a revisit of all the API users, in case they are passing a possible error value to it. I am fine at attempting to fix that, but would need an Ack from Mark first. -- viresh