From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758640AbeAIOsc (ORCPT + 1 other); Tue, 9 Jan 2018 09:48:32 -0500 Received: from pandora.armlinux.org.uk ([78.32.30.218]:34580 "EHLO pandora.armlinux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758511AbeAIOsV (ORCPT ); Tue, 9 Jan 2018 09:48:21 -0500 Date: Tue, 9 Jan 2018 14:47:53 +0000 From: Russell King - ARM Linux To: Xiongwei Song Cc: rafael.j.wysocki@intel.com, ulf.hansson@linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, sxwjean@gmail.com Subject: Re: [PATCH] ARM: locomo: fix free dev incorrectly Message-ID: <20180109144753.GJ17719@n2100.armlinux.org.uk> References: <20180109143755.16931-1-sxwjean@me.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180109143755.16931-1-sxwjean@me.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Tue, Jan 09, 2018 at 10:37:55PM +0800, Xiongwei Song wrote: > In function locomo_init_one_child, If kzalloc call is failed for dev we > would goto out label, then call kfree for dev, however, dev is NULL, we > shouldn't do this. kfree() internally checks for NULL pointers so callers don't have to. Your patch is not necessary. -- RMK's Patch system: http://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up According to speedtest.net: 8.21Mbps down 510kbps up