Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Revert "Staging: drivers: rtl8188eu: use sizeof(*ptr) instead of sizeof(struct)"

This reverts commit 99aded71b52c ("Staging: drivers: rtl8188eu: use
sizeof(*ptr) instead of sizeof(struct)").

This commit is wrong, as adapt->HalData has a type of "void *", so
now we are allocating a much to small struct, which causes the driver
to overwrite random memory which leads to a non working driver and
various system crashes.

Cc: Jacky Boen <aqiank@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Hans de Goede and committed by
Greg Kroah-Hartman
6982f867 a9cc4006

+2 -1
+2 -1
drivers/staging/rtl8188eu/hal/usb_halinit.c
··· 2072 2072 { 2073 2073 struct hal_ops *halfunc = &adapt->HalFunc; 2074 2074 2075 - adapt->HalData = kzalloc(sizeof(*adapt->HalData), GFP_KERNEL); 2075 + 2076 + adapt->HalData = kzalloc(sizeof(struct hal_data_8188e), GFP_KERNEL); 2076 2077 if (!adapt->HalData) 2077 2078 DBG_88E("cant not alloc memory for HAL DATA\n"); 2078 2079