From patchwork Sat Oct 9 11:54:06 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 243351 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o99BsWH6003523 for ; Sat, 9 Oct 2010 11:54:32 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755311Ab0JILyZ (ORCPT ); Sat, 9 Oct 2010 07:54:25 -0400 Received: from mail-ww0-f44.google.com ([74.125.82.44]:54352 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754841Ab0JILyY (ORCPT ); Sat, 9 Oct 2010 07:54:24 -0400 Received: by wwj40 with SMTP id 40so2123879wwj.1 for ; Sat, 09 Oct 2010 04:54:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:mime-version:content-type:content-disposition:user-agent; bh=xGHv9CjYyBXyFY9i7mp5USlgF0hA6DQuopznd+VFCQI=; b=SO3xeRd2J1aLvG1oA9GSJoWj7SFux3A58bzvNHbZw25E2KvRTMcTKPHKpb35j8qUUT kZjTwb0Hs98QGqhjU+kCOiNUuBDM5nWkLaI8qlQ8cpAd5WZnxACD/fkwnYRvDWSx4jhE q4HH1kZuJyPGnx26P19aqIo+Cdrao/jOy0yCo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=TNONfKum/kW/36zjsmgY3n6Qo8QT0U/lBwyw010I7eySXNItR0Vu8bHPsEmxm4AQyw uqvWOBb/mtOf4cozeH2B1ERL7nnjDDVcjXOy/ff/bZXjXE3XnvkO2y5AYIz2Sklfy9y5 K7x9bjvigtEWE33cvlQUcbZhbysoe2l+qTVGw= Received: by 10.227.135.78 with SMTP id m14mr3551086wbt.47.1286625263243; Sat, 09 Oct 2010 04:54:23 -0700 (PDT) Received: from bicker (h3f05.n1.ips.mtn.co.ug [41.210.191.5]) by mx.google.com with ESMTPS id i19sm1369913wbe.11.2010.10.09.04.54.17 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 09 Oct 2010 04:54:22 -0700 (PDT) Date: Sat, 9 Oct 2010 13:54:06 +0200 From: Dan Carpenter To: Brett Rudley Cc: Henry Ptasinski , Nohee Ko , Greg Kroah-Hartman , Jason Cooper , Grant Grundler , linux-wireless@vger.kernel.org, devel@driverdev.osuosl.org, kernel-janitors@vger.kernel.org Subject: [patch] Staging: brcm80211: make interface name buffer smaller Message-ID: <20101009115406.GR11681@bicker> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Sat, 09 Oct 2010 11:54:33 +0000 (UTC) diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c index 72eed5b..d513069 100644 --- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c +++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c @@ -217,7 +217,7 @@ typedef struct dhd_if { u8 mac_addr[ETHER_ADDR_LEN]; /* assigned MAC address */ bool attached; /* Delayed attachment when unset */ bool txflowcontrol; /* Per interface flow control indicator */ - char name[IFNAMSIZ + 1]; /* linux interface name */ + char name[IFNAMSIZ]; /* linux interface name */ } dhd_if_t; /* Local private structure (extension of pub) */ @@ -1871,8 +1871,7 @@ dhd_add_if(dhd_info_t *dhd, int ifidx, void *handle, char *name, memset(ifp, 0, sizeof(dhd_if_t)); ifp->info = dhd; dhd->iflist[ifidx] = ifp; - strncpy(ifp->name, name, IFNAMSIZ); - ifp->name[IFNAMSIZ] = '\0'; + strlcpy(ifp->name, name, IFNAMSIZ); if (mac_addr != NULL) memcpy(&ifp->mac_addr, mac_addr, ETHER_ADDR_LEN);