From: Clemens Ladisch <clemens@ladisch.de>
To: alsa-devel@lists.sourceforge.net
Cc: martin-langer@gmx.de
Subject: Re: my first usb-midi experiment ends with segmentation fault
Date: Tue, 30 Jul 2002 18:38:31 +0200 [thread overview]
Message-ID: <3D46C107.2E108CEB@ladisch.de> (raw)
In-Reply-To: 200207301708.07066.plcl@telefonica.net
Pedro Lopez-Cabanillas wrote:
>
> El Mar 30 Jul 2002 15:09, Clemens Ladisch escribió:
> > - if (port < 0)
> > + if (port < 0) {
> > + snd_printk(KERN_ERR "cannot create port (error code %d)\n", err);
> > return port;
>
> I think that you mean:
> snd_printk(KERN_ERR "cannot create port (error code %d)\n", port);
>
> Right? :)
Yes, thank you.
Here again the same patch, now correct. (I hope :-)
Index: usb/usbmidi.c
===================================================================
RCS file: /cvsroot/alsa/alsa-driver/usb/usbmidi.c,v
retrieving revision 1.4
diff -u -r1.4 usbmidi.c
--- usb/usbmidi.c 5 Jul 2002 13:39:28 -0000 1.4
+++ usb/usbmidi.c 30 Jul 2002 16:33:28 -0000
@@ -834,8 +834,10 @@
port = snd_seq_event_port_attach(umidi->seq_client,
&port_callback,
cap, type, port_name);
- if (port < 0)
+ if (port < 0) {
+ snd_printk(KERN_ERR "cannot create port (error code %d)\n", port);
return port;
+ }
if (in)
umidi->endpoints[ep].in->ports[c].seq_port = port;
@@ -1084,6 +1086,8 @@
usb_ms_endpoint_descriptor_t* ms_ep;
int i, epidx;
+ memset(device_info, 0, sizeof(*device_info));
+
if (usb_device->descriptor.iManufacturer == 0 ||
usb_string(usb_device, usb_device->descriptor.iManufacturer,
device_info->vendor, sizeof(device_info->vendor)) < 0)
@@ -1180,12 +1184,15 @@
{
usbmidi_device_info_t device_info;
snd_card_t* card = NULL;
+ int err;
if (snd_usbmidi_get_device_info(device, ifnum, device_id,
&device_info) == 0) {
printk(KERN_INFO "snd-usb-midi: detected %s %s\n",
device_info.vendor, device_info.product);
- snd_usbmidi_card_create(device, &device_info, &card);
+ err = snd_usbmidi_card_create(device, &device_info, &card);
+ if (err < 0)
+ snd_printk(KERN_ERR "cannot create card (error code %d)\n", err);
}
return card;
}
-------------------------------------------------------
This sf.net email is sponsored by: Dice - The leading online job board
for high-tech professionals. Search and apply for tech jobs today!
http://seeker.dice.com/seeker.epl?rel_code1
next prev parent reply other threads:[~2002-07-30 16:38 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-07-28 21:39 my first usb-midi experiment ends with segmentation fault Martin Langer
2002-07-29 10:40 ` Takashi Iwai
2002-07-29 12:30 ` Martin Langer
2002-07-29 21:51 ` Pedro Lopez-Cabanillas
2002-07-30 13:09 ` Clemens Ladisch
2002-07-30 15:08 ` Pedro Lopez-Cabanillas
2002-07-30 16:38 ` Clemens Ladisch [this message]
2002-07-30 18:18 ` Martin Langer
2002-07-30 21:42 ` Martin Langer
2002-07-30 21:43 ` Pedro Lopez-Cabanillas
2002-07-31 10:02 ` [Alsa-devel][Patch] usbmidi fixes Clemens Ladisch
2002-07-31 10:45 ` Martin Langer
2002-07-31 14:38 ` Takashi Iwai
2002-07-31 10:26 ` my first usb-midi experiment ends with segmentation fault Clemens Ladisch
2002-07-31 21:02 ` Martin Langer
2002-08-01 9:48 ` Clemens Ladisch
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=3D46C107.2E108CEB@ladisch.de \
--to=clemens@ladisch.de \
--cc=alsa-devel@lists.sourceforge.net \
--cc=martin-langer@gmx.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.