Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756845AbcKKU3S (ORCPT ); Fri, 11 Nov 2016 15:29:18 -0500 Received: from mail-qk0-f172.google.com ([209.85.220.172]:33467 "EHLO mail-qk0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756313AbcKKU3P (ORCPT ); Fri, 11 Nov 2016 15:29:15 -0500 MIME-Version: 1.0 In-Reply-To: <20161109145401.25327-2-ahaslam@baylibre.com> References: <20161109145401.25327-1-ahaslam@baylibre.com> <20161109145401.25327-2-ahaslam@baylibre.com> From: Linus Walleij Date: Fri, 11 Nov 2016 21:29:02 +0100 Message-ID: Subject: Re: [PATCH v2 1/2] pinctrl: single: check for any error when getting rows To: Axel Haslam Cc: ext Tony Lindgren , Haojian Zhuang , Kevin Hilman , "Nori, Sekhar" , "linux-arm-kernel@lists.infradead.org" , Linux-OMAP , "linux-gpio@vger.kernel.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 468 Lines: 16 On Wed, Nov 9, 2016 at 3:54 PM, Axel Haslam wrote: > pinctrl_count_index_with_args returns -ENOENT not > -EINVAL. The return check would pass, and we would > try to kzalloc with a negative error size throwing > a warning. > > Instead of checking for -EINVAL specifically, lets > check for any error and avoid negative size allocations. > > Signed-off-by: Axel Haslam Patch applied with Tony's ACK. Yours, Linus Walleij