]> git.baikalelectronics.ru Git - kernel.git/commit
rtl818x: make dev_alloc_skb() null pointer check to really work
authorandrea merello <andrea.merello@gmail.com>
Tue, 18 Feb 2014 01:10:43 +0000 (02:10 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 28 Feb 2014 19:08:28 +0000 (14:08 -0500)
commitd7602a339e2ebe3458096f523e84d62a7e51a085
treee8f8ba87b4ca09aec59495bb9eaa8c232ffca627
parente0062649e88e9e556ef91c4a5b56aba51936f096
rtl818x: make dev_alloc_skb() null pointer check to really work

During driver initialization, some skbs are preallocated for RX.
Currenly if the allocation fails, the driver's allocation routine
exits immediatly but it will return zero (success) anyway.

In this way the driver will continue initialization with buggy
pointers around.

This patch makes the driver's allocation routine to return
an error value and to print a complaint message when skb allocation
fails.
In this way its caller will not go further, avoinding the driver to
successfully load, and preventing dereferencing buggy pointers.

An hint is thus printed about why the driver failed.

Signed-off-by: Andrea Merello <andrea.merello@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rtl818x/rtl8180/dev.c