From patchwork Fri Nov 27 22:11:57 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 63410 X-Patchwork-Delegate: deller@gmx.de 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 nARMBdXa022165 for ; Fri, 27 Nov 2009 22:12:02 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752527AbZK0WLz (ORCPT ); Fri, 27 Nov 2009 17:11:55 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752608AbZK0WLz (ORCPT ); Fri, 27 Nov 2009 17:11:55 -0500 Received: from mail.gmx.net ([213.165.64.20]:50927 "HELO mail.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1752527AbZK0WLz (ORCPT ); Fri, 27 Nov 2009 17:11:55 -0500 Received: (qmail invoked by alias); 27 Nov 2009 22:11:59 -0000 Received: from p4FDB28C3.dip0.t-ipconnect.de (EHLO p100.box) [79.219.40.195] by mail.gmx.net (mp006) with SMTP; 27 Nov 2009 23:11:59 +0100 X-Authenticated: #1045983 X-Provags-ID: V01U2FsdGVkX1/HflYEmk3Hnlcm2900vYmbVNs5aq5Kkhr5VhS80A Rp0+snD2FQaj1r Date: Fri, 27 Nov 2009 23:11:57 +0100 From: Helge Deller To: Rusty Russell , linux-parisc@vger.kernel.org, Kyle McMartin , James Bottomley , roland@redhat.com, dave@hiauly1.hia.nrc.ca Subject: Re: kernel segv with 2.6.31-rc6 ? Message-ID: <20091127221156.GA5334@p100.box> References: <4A89CC4D.5040801@gmx.de> <20090818050637.4C3E74730F@magilla.sf.frob.com> <1250640565.15079.3.camel@mulgrave.site> <200908251707.01610.rusty@rustcorp.com.au> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <200908251707.01610.rusty@rustcorp.com.au> User-Agent: Mutt/1.5.19 (2009-01-05) X-Y-GMX-Trusted: 0 X-FuHaFi: 0.43 Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org diff --git a/kernel/module.c b/kernel/module.c index 8b7d880..5842a71 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -1187,7 +1187,8 @@ static void add_sect_attrs(struct module *mod, unsigned int nsect, /* Count loaded sections and allocate structures */ for (i = 0; i < nsect; i++) - if (sechdrs[i].sh_flags & SHF_ALLOC) + if (sechdrs[i].sh_flags & SHF_ALLOC + && sechdrs[i].sh_size) nloaded++; size[0] = ALIGN(sizeof(*sect_attrs) + nloaded * sizeof(sect_attrs->attrs[0]), @@ -1207,6 +1208,8 @@ static void add_sect_attrs(struct module *mod, unsigned int nsect, for (i = 0; i < nsect; i++) { if (! (sechdrs[i].sh_flags & SHF_ALLOC)) continue; + if (!sechdrs[i].sh_size) + continue; sattr->address = sechdrs[i].sh_addr; sattr->name = kstrdup(secstrings + sechdrs[i].sh_name, GFP_KERNEL);