From patchwork Mon Jul 6 22:23:36 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sonasath, Moiz" X-Patchwork-Id: 34347 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n66MNkvH025529 for ; Mon, 6 Jul 2009 22:23:47 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752194AbZGFWXl (ORCPT ); Mon, 6 Jul 2009 18:23:41 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752851AbZGFWXk (ORCPT ); Mon, 6 Jul 2009 18:23:40 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:40839 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752194AbZGFWXk convert rfc822-to-8bit (ORCPT ); Mon, 6 Jul 2009 18:23:40 -0400 Received: from dlep33.itg.ti.com ([157.170.170.112]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id n66MNbcE017321; Mon, 6 Jul 2009 17:23:42 -0500 Received: from dlep20.itg.ti.com (localhost [127.0.0.1]) by dlep33.itg.ti.com (8.13.7/8.13.7) with ESMTP id n66MNb80017651; Mon, 6 Jul 2009 17:23:37 -0500 (CDT) Received: from dlee73.ent.ti.com (localhost [127.0.0.1]) by dlep20.itg.ti.com (8.12.11/8.12.11) with ESMTP id n66MNabY009302; Mon, 6 Jul 2009 17:23:36 -0500 (CDT) Received: from dlee06.ent.ti.com ([157.170.170.11]) by dlee73.ent.ti.com ([157.170.170.88]) with mapi; Mon, 6 Jul 2009 17:23:36 -0500 From: "Sonasath, Moiz" To: "David S. Miller" , "netdev@vger.kernel.org" CC: "linux-omap@vger.kernel.org" , "Pandita, Vikram" Date: Mon, 6 Jul 2009 17:23:36 -0500 Subject: [PATCH] [RFC] Potential bug in defining 'irq field' of 'ifmap structure' Thread-Topic: [PATCH] [RFC] Potential bug in defining 'irq field' of 'ifmap structure' Thread-Index: Acn+h50zFQ5FvunZRJ+olsRwEI4suQAADRSw Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org From: Moiz Sonasath There seems to be a bug in the ioctl implementation in /kernel/net/core/dev.c dev_ifsioc_locked() case SIOCGIFMAP: ifr->ifr_map.irq = dev->irq; // ?? type mismatch Here ifr->ifr_map.irq) is of type unsigned char dev-irq is of type unsigned int So ifconfig reports a wrong irq number when the dev->irq number is > 255. I am confused to see the same typedefs in file: net/if.h Not sure how to make changes for the user side net/if.h file? Signed-off-by: Moiz Sonasath Signed-off-by: Vikram Pandita --- include/linux/if.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/include/linux/if.h b/include/linux/if.h index 2d89c96..1ac6559 100644 --- a/include/linux/if.h +++ b/include/linux/if.h @@ -126,7 +126,7 @@ struct ifmap unsigned long mem_start; unsigned long mem_end; unsigned short base_addr; - unsigned char irq; + unsigned int irq; unsigned char dma; unsigned char port; /* 3 bytes spare */