From patchwork Wed Dec 30 11:41:38 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalle Valo X-Patchwork-Id: 70232 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id nBUBgGjo006849 for ; Wed, 30 Dec 2009 11:42:16 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751900AbZL3Llt (ORCPT ); Wed, 30 Dec 2009 06:41:49 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752044AbZL3Lls (ORCPT ); Wed, 30 Dec 2009 06:41:48 -0500 Received: from mail-ew0-f219.google.com ([209.85.219.219]:52859 "EHLO mail-ew0-f219.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751551AbZL3Llr (ORCPT ); Wed, 30 Dec 2009 06:41:47 -0500 Received: by ewy19 with SMTP id 19so3573554ewy.21 for ; Wed, 30 Dec 2009 03:41:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:to:cc:subject:from :date:message-id:user-agent:mime-version:content-type; bh=h8nB+G7k69ccju6/GtoQsh/cmT+d74T9Qy8SDKQ74vw=; b=fmm9ip3rWIQBs3uzZ6ZT5brkd2RnUcvCfXvdob5xKpZbc0f2hy5/7+o0Wb1iB3aifC +t6u2yEvBfpM4lp5qYuzmdXSEWU00SmAptvdEnJzl6WLzak56+EJMmWQ3HokBOSkLCt3 gxcrcd7HrnZ6eYttB4hdSn5xDb6G+L1UUdAik= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:to:cc:subject:from:date:message-id:user-agent:mime-version :content-type; b=eGgGn6QCKkU8wsVXPSKcqNUEYc92DLEVDNinBLwmvCM9DtxhNIxMAKyo0/dIcwcfLI mawulotvEkZkybOsE0ROUqM7KboyKWju5haY8eM0KC+wgbNAstWXjHyATSqVcwABJcHt QRVYVQy84C/Ka2aI7ap+ciYz0y8uxJ8zQ8Qsw= Received: by 10.213.103.83 with SMTP id j19mr6283691ebo.30.1262173301293; Wed, 30 Dec 2009 03:41:41 -0800 (PST) Received: from purkki.valot.fi (purkki.valot.fi [80.68.90.206]) by mx.google.com with ESMTPS id 13sm9462089ewy.5.2009.12.30.03.41.39 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 30 Dec 2009 03:41:40 -0800 (PST) To: linux-kernel@vger.kernel.org Cc: linux-wireless@vger.kernel.org, linux-omap@vger.kernel.org, Helge Deller , rusty@rustcorp.com.au, akpm@linux-foundation.org, James.Bottomley@HansenPartnership.com, roland@redhat.com, dave@hiauly1.hia.nrc.ca Subject: regression: crash from 'ls /sys/modules/wl1251_spi/notes' From: Kalle Valo Date: Wed, 30 Dec 2009 13:41:38 +0200 Message-ID: <87k4w4wux9.fsf@purkki.valot.fi> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org --- a/kernel/module.c +++ b/kernel/module.c @@ -1189,10 +1189,13 @@ static void add_notes_attrs(struct module *mod, unsigned int nsect, if (!notes_attrs->dir) goto out; - for (i = 0; i < notes; ++i) + for (i = 0; i < notes; ++i) { + if (WARN_ON(!notes_attrs->attrs[i].attr.name)) + continue; if (sysfs_create_bin_file(notes_attrs->dir, ¬es_attrs->attrs[i])) goto out; + } mod->notes_attrs = notes_attrs;