Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1734272 > unrolled thread
| Started by | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| First post | 2017-09-18 18:20 +0200 |
| Last post | 2017-09-18 18:20 +0200 |
| Articles | 1 — 1 participant |
Back to article view | Back to linux.kernel
[PATCH] [media] gspca: Delete two error messages for a failed memory allocation in gspca_dev_probe2() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-09-18 18:20 +0200
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2017-09-18 18:20 +0200 |
| Subject | [PATCH] [media] gspca: Delete two error messages for a failed memory allocation in gspca_dev_probe2() |
| Message-ID | <ur6W7-7F-17@gated-at.bofh.it> |
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 18 Sep 2017 17:47:58 +0200
Omit extra messages for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/media/usb/gspca/gspca.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/media/usb/gspca/gspca.c b/drivers/media/usb/gspca/gspca.c
index 0f141762abf1..8be1c81b7cab 100644
--- a/drivers/media/usb/gspca/gspca.c
+++ b/drivers/media/usb/gspca/gspca.c
@@ -2037,10 +2037,8 @@ int gspca_dev_probe2(struct usb_interface *intf,
- if (!gspca_dev) {
- pr_err("couldn't kzalloc gspca struct\n");
+ if (!gspca_dev)
return -ENOMEM;
- }
+
gspca_dev->usb_buf = kmalloc(USB_BUF_SZ, GFP_KERNEL);
if (!gspca_dev->usb_buf) {
- pr_err("out of memory\n");
ret = -ENOMEM;
goto out;
}
--
2.14.1
Back to top | Article view | linux.kernel
csiph-web