Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9351982b25ace7ee5ed82b6f4a7ea1151f31d267 Commit: 9351982b25ace7ee5ed82b6f4a7ea1151f31d267 Parent: 80ba80a9bf25d251237694c3fcee850a73324532 Author: Micah Gruber <[EMAIL PROTECTED]> AuthorDate: Mon Jul 23 16:05:52 2007 +0800 Committer: Jeff Garzik <[EMAIL PROTECTED]> CommitDate: Mon Jul 30 15:44:50 2007 -0400
Fix a potential NULL pointer dereference in write_bulk_callback() in drivers/net/usb/pegasus.c This patch fixes a potential null dereference bug where we dereference pegasus before a null check. This patch simply moves the dereferencing after the null check. Signed-off-by: Micah Gruber <[EMAIL PROTECTED]> Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]> --- drivers/net/usb/pegasus.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/drivers/net/usb/pegasus.c b/drivers/net/usb/pegasus.c index a05fd97..04cba6b 100644 --- a/drivers/net/usb/pegasus.c +++ b/drivers/net/usb/pegasus.c @@ -768,11 +768,13 @@ done: static void write_bulk_callback(struct urb *urb) { pegasus_t *pegasus = urb->context; - struct net_device *net = pegasus->net; + struct net_device *net; if (!pegasus) return; + net = pegasus->net; + if (!netif_device_present(net) || !netif_running(net)) return; - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html