From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752288AbdBFWsa (ORCPT ); Mon, 6 Feb 2017 17:48:30 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:46650 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751870AbdBFWs2 (ORCPT ); Mon, 6 Feb 2017 17:48:28 -0500 DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org A29D96081B Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=sboyd@codeaurora.org Date: Mon, 6 Feb 2017 14:48:25 -0800 From: Stephen Boyd To: Maxime Ripard Cc: Michael Turquette , linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, Chen-Yu Tsai Subject: Re: [PATCH] clk: sunxi-ng: Check kzalloc() for errors and cleanup error path Message-ID: <20170206224825.GG25384@codeaurora.org> References: <20170203230050.26181-1-sboyd@codeaurora.org> <20170206105120.5gxti6szfmxi4psc@lukather> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170206105120.5gxti6szfmxi4psc@lukather> 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 02/06, Maxime Ripard wrote: > On Fri, Feb 03, 2017 at 03:00:50PM -0800, Stephen Boyd wrote: > > This kzalloc() could fail. Let's bail out with -ENOMEM here > > instead of NULL dereferencing. That silences static checkers. We > > should also cleanup on the error path even though this function > > returning an error probably means the system won't boot. > > > > Cc: Chen-Yu Tsai > > Cc: Maxime Ripard > > Signed-off-by: Stephen Boyd > > Acked-by: Maxime Ripard > > Can you apply it directly? > Yep. Thanks. -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project