From: matthieu castet <castet.matthieu@free.fr>
To: greg@kroah.com
Cc: linux-kernel@vger.kernel.org, usbatm@lists.infradead.org,
linux-usb-devel@lists.sourceforge.net,
ueagle <ueagleatm-dev@gna.org>, Andrew Morton <akpm@osdl.org>,
bunk@stusta.de, Ernst Herzberg <list-lkml@net4u.de>,
laurent.riffard@free.fr
Subject: [PATCH 1/1] UEAGLE : fix ueagle-atm Oops on 2.6.19-rc1 and 2.6.19-rc1-mm
Date: Wed, 11 Oct 2006 19:14:08 +0200 [thread overview]
Message-ID: <452D2660.5000804@free.fr> (raw)
[-- Attachment #1: Type: text/plain, Size: 490 bytes --]
Hi,
this patch fix :
Subject : ueagle-atm Oops
References : http://lkml.org/lkml/2006/10/6/390
Submitter : Ernst Herzberg <list-lkml@net4u.de>
Caused-By : Greg Kroah-Hartman <gregkh@suse.de>
commit e7ccdfec087f02930c5cdc81143d4a045ae8d361
Handled-By : Matthieu Castet <castet.matthieu@free.fr>
Laurent Riffard
Patch : https://mail.gna.org/public/ueagleatm-dev/2006-10/msg00022.html
Status : "patch available, but some cleaning is needed"
---
[-- Attachment #2: ueagle-sysfsfix --]
[-- Type: text/plain, Size: 1844 bytes --]
The array of attribute passed to sysfs_create_group() must be
NULL-terminated.
The sysfs entries are created before the start of the modem state machine to avoid to stop it in case of errors in sysfs creation.
Also {destroy,create}_fs_entries are removed as they do nothing.
Signed-off-by: Laurent Riffard <laurent.riffard@free.fr>
Signed-off-by: Matthieu CASTET <castet.matthieu@free.fr>
Index: linux-2.6.16/drivers/usb/atm/ueagle-atm.c
===================================================================
--- linux-2.6.16.orig/drivers/usb/atm/ueagle-atm.c 2006-10-10 19:29:39.000000000 +0200
+++ linux-2.6.16/drivers/usb/atm/ueagle-atm.c 2006-10-11 19:05:44.000000000 +0200
@@ -1648,16 +1648,12 @@
&dev_attr_stat_usunc.attr,
&dev_attr_stat_dsunc.attr,
&dev_attr_stat_firmid.attr,
+ NULL,
};
static struct attribute_group attr_grp = {
.attrs = attrs,
};
-static int create_fs_entries(struct usb_interface *intf)
-{
- return sysfs_create_group(&intf->dev.kobj, &attr_grp);
-}
-
static int uea_bind(struct usbatm_data *usbatm, struct usb_interface *intf,
const struct usb_device_id *id)
{
@@ -1717,31 +1713,25 @@
}
}
+ ret = sysfs_create_group(&intf->dev.kobj, &attr_grp);
+ if (ret < 0)
+ goto error;
+
ret = uea_boot(sc);
- if (ret < 0) {
- kfree(sc);
- return ret;
- }
+ if (ret < 0)
+ goto error;
- ret = create_fs_entries(intf);
- if (ret) {
- uea_stop(sc);
- kfree(sc);
- return ret;
- }
return 0;
-}
-
-static void destroy_fs_entries(struct usb_interface *intf)
-{
- sysfs_remove_group(&intf->dev.kobj, &attr_grp);
+error:
+ kfree(sc);
+ return ret;
}
static void uea_unbind(struct usbatm_data *usbatm, struct usb_interface *intf)
{
struct uea_softc *sc = usbatm->driver_data;
- destroy_fs_entries(intf);
+ sysfs_remove_group(&intf->dev.kobj, &attr_grp);
uea_stop(sc);
kfree(sc);
}
reply other threads:[~2006-10-11 17:14 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=452D2660.5000804@free.fr \
--to=castet.matthieu@free.fr \
--cc=akpm@osdl.org \
--cc=bunk@stusta.de \
--cc=greg@kroah.com \
--cc=laurent.riffard@free.fr \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb-devel@lists.sourceforge.net \
--cc=list-lkml@net4u.de \
--cc=ueagleatm-dev@gna.org \
--cc=usbatm@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox