Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755013Ab1FMWMO (ORCPT ); Mon, 13 Jun 2011 18:12:14 -0400 Received: from mail.vyatta.com ([76.74.103.46]:44338 "EHLO mail.vyatta.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753841Ab1FMWMM (ORCPT ); Mon, 13 Jun 2011 18:12:12 -0400 Date: Mon, 13 Jun 2011 18:12:12 -0400 From: Stephen Hemminger To: Greg Thelen Cc: Stephen Hemminger , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] sky2: avoid using uninitialized variable Message-ID: <20110613181212.571f8e76@s6510.ftrdhcpuser.net> In-Reply-To: References: Organization: Vyatta X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1048 Lines: 28 On Mon, 13 Jun 2011 14:21:59 -0700 Greg Thelen wrote: > I am not sure if 0 or ~0 would be a better choice in the gm_phy_read() > error case. I used 0. A more complete solution might be to plumb up > error handling to the callers of gm_phy_read(). > > == > From 37486219a3d93881f3b2619a4b2bb21be62db7d4 Mon Sep 17 00:00:00 2001 > From: Greg Thelen > Date: Mon, 13 Jun 2011 14:09:07 -0700 > Subject: [PATCH] sky2: avoid using uninitialized variable > > Prior to this change gm_phy_read() could return an uninitialized > variable if __gm_phy_read() failed. > > This change returns zero in the failure case. > > Signed-off-by: Greg Thelen Shouldn't the callers be changed to check rather than just returning 0 and masking the problem. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/