mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-05 10:29:37 +00:00
usb-misc: sisusbvga: fix error path
Remove a call to dev_err() that was reporting an unsuccesful call to kmalloc(), as reporting memory allocation failures is redundant. Instead of logging the error, clean up previously allocated resources and abort the probe with -ENOMEM. Before this change sisusb->SiS_Pr could be dereferenced even if null after failure of memory allocation. Signed-off-by: Peter Senna Tschudin <peter.senna@collabora.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
f40849b868
commit
0e781c2258
1 changed files with 2 additions and 1 deletions
|
@ -3112,7 +3112,8 @@ static int sisusb_probe(struct usb_interface *intf,
|
|||
/* Allocate our SiS_Pr */
|
||||
sisusb->SiS_Pr = kmalloc(sizeof(struct SiS_Private), GFP_KERNEL);
|
||||
if (!sisusb->SiS_Pr) {
|
||||
dev_err(&sisusb->sisusb_dev->dev, "Failed to allocate SiS_Pr\n");
|
||||
retval = -ENOMEM;
|
||||
goto error_4;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in a new issue