From: Christian Lamparter <chunkeey@googlemail.com>
To: Larry Finger <Larry.Finger@lwfinger.net>
Cc: David Woodhouse <dwmw2@infradead.org>,
linville@tuxdriver.com, libertas-dev@lists.infradead.org,
linux-wireless@vger.kernel.org, dcbw@redhat.com,
stern@rowland.harvard.edu, davem@davemloft.net
Subject: Re: [PATCH] libertas if_usb: Fix crash on 64-bit machines
Date: Fri, 30 Oct 2009 19:44:14 +0100 [thread overview]
Message-ID: <200910301944.14740.chunkeey@googlemail.com> (raw)
In-Reply-To: <4AEB2F13.50102@lwfinger.net>
On Friday 30 October 2009 19:23:15 Larry Finger wrote:
> David Woodhouse wrote:
> > On a 64-bit kernel, skb->tail is an offset, not a pointer. The libertas
> > usb driver passes it to usb_fill_bulk_urb() anyway, causing interesting
> > crashes. Fix that by using skb->data instead.
> >
> > This highlights a problem with usb_fill_bulk_urb(). It doesn't notice
> > when dma_map_single() fails and return the error to its caller as it
> > should. In fact it _can't_ currently return the error, since it returns
> > void.
>
> This should be fixed. If changing the code to return the error would
> be too invasive (It is used in 30+ drivers), perhaps the routine
> should be modified to log a warning when dma mapping fails. I will
> submit an RFC to do that.
err, hold on a sec:
- include/linux/usb.h -
static inline void usb_fill_bulk_urb(struct urb *urb,
struct usb_device *dev,
unsigned int pipe,
void *transfer_buffer,
int buffer_length,
usb_complete_t complete_fn,
void *context)
{
urb->dev = dev;
urb->pipe = pipe;
urb->transfer_buffer = transfer_buffer;
urb->transfer_buffer_length = buffer_length;
urb->complete = complete_fn;
urb->context = context;
}
that's just a fill-in macro.
AFAICT usb_submit_urb does the tricky dma mapping.
Regards,
Chr
next prev parent reply other threads:[~2009-10-30 18:44 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-30 17:45 [PATCH] libertas if_usb: Fix crash on 64-bit machines David Woodhouse
2009-10-30 18:17 ` David Miller
2009-10-30 18:23 ` Larry Finger
2009-10-30 18:44 ` Christian Lamparter [this message]
2009-10-30 18:51 ` David Woodhouse
2009-10-30 19:08 ` Larry Finger
2009-10-30 19:26 ` Christian Lamparter
2009-11-04 19:16 ` John W. Linville
2009-11-04 19:36 ` David Woodhouse
2009-11-04 20:01 ` Dan Williams
2009-11-04 21:16 ` John W. Linville
2009-11-04 22:12 ` [PATCH] libertas if_usb: tiny usb-rx overhaul Christian Lamparter
2009-11-10 7:02 ` Dan Williams
2009-10-31 1:41 ` [PATCH] libertas if_usb: Fix crash on 64-bit machines Alan Stern
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=200910301944.14740.chunkeey@googlemail.com \
--to=chunkeey@googlemail.com \
--cc=Larry.Finger@lwfinger.net \
--cc=davem@davemloft.net \
--cc=dcbw@redhat.com \
--cc=dwmw2@infradead.org \
--cc=libertas-dev@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=stern@rowland.harvard.edu \
/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.