From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758987AbbIDODJ (ORCPT ); Fri, 4 Sep 2015 10:03:09 -0400 Received: from eu-smtp-delivery-143.mimecast.com ([146.101.78.143]:21576 "EHLO eu-smtp-delivery-143.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752296AbbIDODG convert rfc822-to-8bit (ORCPT ); Fri, 4 Sep 2015 10:03:06 -0400 Subject: Re: [PATCH] device property: Don't overwrite addr when failing in device_get_mac_address To: Julien Grall , "davem@davemloft.net" References: <1441321190-25631-1-git-send-email-julien.grall@citrix.com> Cc: "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , "netdev@vger.kernel.org" From: Jeremy Linton Message-ID: <55E9A494.5000108@arm.com> Date: Fri, 4 Sep 2015 09:03:00 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <1441321190-25631-1-git-send-email-julien.grall@citrix.com> X-OriginalArrivalTime: 04 Sep 2015 14:03:03.0862 (UTC) FILETIME=[6AACCD60:01D0E71A] X-MC-Unique: tqBzBLZvTCmwQGgea3AsGg-1 Content-Type: text/plain; charset=WINDOWS-1252; format=flowed Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/03/2015 05:59 PM, Julien Grall wrote: > The function device_get_mac_address is trying different property names > in order to get the mac address. To check the return value, the variable > addr (which contain the buffer pass by the caller) will be re-used. This > means that if the previous property is not found, the next property will > be read using a NULL buffer. Thanks for catching that! I checked the OF version to see if it has the same problem, but of course it doesn't because I added the logic to pass the buffer into the routine. Reviewed-by: Jeremy Linton