From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756049AbdEFIkc (ORCPT ); Sat, 6 May 2017 04:40:32 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:50761 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752374AbdEFIkX (ORCPT ); Sat, 6 May 2017 04:40:23 -0400 Date: Sat, 6 May 2017 11:40:04 +0300 From: Dan Carpenter To: Greg KH Cc: Christophe JAILLET , thierry.escande@collabora.com, wnhuang@google.com, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH] firmware: Google VPD: Fix memory allocation error handling Message-ID: <20170506084004.awyhl2w2b2qnbvt2@mwanda> References: <20170505190844.2945-1-christophe.jaillet@wanadoo.fr> <20170505195647.GB7351@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170505195647.GB7351@kroah.com> User-Agent: NeoMutt/20170113 (1.7.2) X-Source-IP: userv0021.oracle.com [156.151.31.71] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 05, 2017 at 12:56:47PM -0700, Greg KH wrote: > On Fri, May 05, 2017 at 09:08:44PM +0200, Christophe JAILLET wrote: > > This patch fixes several issues: > > - if the 1st 'kzalloc' fails, we dereference a NULL pointer > > - if the 2nd 'kzalloc' fails, there is a memory leak > > - if 'sysfs_create_bin_file' fails there is also a memory leak > > Then it should be multiple patches, not fixing 3 things in one patch, > right? > I agree with Christophe that this is basically one thing. Otherwise you end up breaking it up how Elfring does it into tiny tiny snippets that I can't read. Doing it this way is easier to review for me. regards, dan carpenter