From owner-svn-src-head@FreeBSD.ORG Sat Sep 13 16:04:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 68B2F5B8; Sat, 13 Sep 2014 16:04:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 53FAE97B; Sat, 13 Sep 2014 16:04:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8DG4u0W099114; Sat, 13 Sep 2014 16:04:56 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8DG4u9D099113; Sat, 13 Sep 2014 16:04:56 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201409131604.s8DG4u9D099113@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sat, 13 Sep 2014 16:04:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271524 - head/sbin/ifconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Sep 2014 16:04:56 -0000 Author: melifaro Date: Sat Sep 13 16:04:55 2014 New Revision: 271524 URL: http://svnweb.freebsd.org/changeset/base/271524 Log: Do not try to read i2c info when no transceiver is present. MFC with: r270064 Sponsored by: Yandex LLC Modified: head/sbin/ifconfig/sfp.c Modified: head/sbin/ifconfig/sfp.c ============================================================================== --- head/sbin/ifconfig/sfp.c Sat Sep 13 16:02:43 2014 (r271523) +++ head/sbin/ifconfig/sfp.c Sat Sep 13 16:04:55 2014 (r271524) @@ -764,11 +764,13 @@ sfp_status(int s, struct ifreq *ifr, int /* * Try to read byte 0 from i2c: * Both SFF-8472 and SFF-8436 use it as - * 'identification byte' + * 'identification byte'. + * Stop reading status on zero as value - + * this might happen in case of empty transceiver slot. */ id_byte = 0; ii.f(&ii, SFF_8472_BASE, SFF_8472_ID, 1, (caddr_t)&id_byte); - if (ii.error != 0) + if (ii.error != 0 || id_byte == 0) return; switch (id_byte) {