diff options
author | Markus Elfring <elfring@users.sourceforge.net> | 2017-08-28 05:46:57 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-09-23 08:19:55 -0400 |
commit | c38e8657a471e9af42b86009e5d3085031b41fda (patch) | |
tree | b2bb818ff8b099ee5237da0ab3b9db680b520a0b | |
parent | a0ec8d1dc42e4255307cb1b95345c01c327a10a6 (diff) |
media: drivers: delete error messages for failed memory allocation
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
[mchehab@s-opensource.com: fold several similar patches into one]
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
23 files changed, 30 insertions, 80 deletions
diff --git a/drivers/media/common/cypress_firmware.c b/drivers/media/common/cypress_firmware.c index 50e3f76d4847..bfe47bc5f716 100644 --- a/drivers/media/common/cypress_firmware.c +++ b/drivers/media/common/cypress_firmware.c | |||
@@ -75,10 +75,8 @@ int cypress_load_firmware(struct usb_device *udev, | |||
75 | int ret, pos = 0; | 75 | int ret, pos = 0; |
76 | 76 | ||
77 | hx = kmalloc(sizeof(struct hexline), GFP_KERNEL); | 77 | hx = kmalloc(sizeof(struct hexline), GFP_KERNEL); |
78 | if (!hx) { | 78 | if (!hx) |
79 | dev_err(&udev->dev, "%s: kmalloc() failed\n", KBUILD_MODNAME); | ||
80 | return -ENOMEM; | 79 | return -ENOMEM; |
81 | } | ||
82 | 80 | ||
83 | /* stop the CPU */ | 81 | /* stop the CPU */ |
84 | hx->data[0] = 1; | 82 | hx->data[0] = 1; |
diff --git a/drivers/media/common/siano/smscoreapi.c b/drivers/media/common/siano/smscoreapi.c index e7a0d7798d5b..889b486fbc72 100644 --- a/drivers/media/common/siano/smscoreapi.c +++ b/drivers/media/common/siano/smscoreapi.c | |||
@@ -1301,10 +1301,8 @@ static int smscore_init_device(struct smscore_device_t *coredev, int mode) | |||
1301 | 1301 | ||
1302 | buffer = kmalloc(sizeof(struct sms_msg_data) + | 1302 | buffer = kmalloc(sizeof(struct sms_msg_data) + |
1303 | SMS_DMA_ALIGNMENT, GFP_KERNEL | GFP_DMA); | 1303 | SMS_DMA_ALIGNMENT, GFP_KERNEL | GFP_DMA); |
1304 | if (!buffer) { | 1304 | if (!buffer) |
1305 | pr_err("Could not allocate buffer for init device message.\n"); | ||
1306 | return -ENOMEM; | 1305 | return -ENOMEM; |
1307 | } | ||
1308 | 1306 | ||
1309 | msg = (struct sms_msg_data *)SMS_ALIGN_ADDRESS(buffer); | 1307 | msg = (struct sms_msg_data *)SMS_ALIGN_ADDRESS(buffer); |
1310 | SMS_INIT_MSG(&msg->x_msg_header, MSG_SMS_INIT_DEVICE_REQ, | 1308 | SMS_INIT_MSG(&msg->x_msg_header, MSG_SMS_INIT_DEVICE_REQ, |
@@ -1687,10 +1685,9 @@ static int smscore_validate_client(struct smscore_device_t *coredev, | |||
1687 | return -EEXIST; | 1685 | return -EEXIST; |
1688 | } | 1686 | } |
1689 | listentry = kzalloc(sizeof(struct smscore_idlist_t), GFP_KERNEL); | 1687 | listentry = kzalloc(sizeof(struct smscore_idlist_t), GFP_KERNEL); |
1690 | if (!listentry) { | 1688 | if (!listentry) |
1691 | pr_err("Can't allocate memory for client id.\n"); | ||
1692 | return -ENOMEM; | 1689 | return -ENOMEM; |
1693 | } | 1690 | |
1694 | listentry->id = id; | 1691 | listentry->id = id; |
1695 | listentry->data_type = data_type; | 1692 | listentry->data_type = data_type; |
1696 | list_add_locked(&listentry->entry, &client->idlist, | 1693 | list_add_locked(&listentry->entry, &client->idlist, |
@@ -1725,10 +1722,8 @@ int smscore_register_client(struct smscore_device_t *coredev, | |||
1725 | } | 1722 | } |
1726 | 1723 | ||
1727 | newclient = kzalloc(sizeof(struct smscore_client_t), GFP_KERNEL); | 1724 | newclient = kzalloc(sizeof(struct smscore_client_t), GFP_KERNEL); |
1728 | if (!newclient) { | 1725 | if (!newclient) |
1729 | pr_err("Failed to allocate memory for client.\n"); | ||
1730 | return -ENOMEM; | 1726 | return -ENOMEM; |
1731 | } | ||
1732 | 1727 | ||
1733 | INIT_LIST_HEAD(&newclient->idlist); | 1728 | INIT_LIST_HEAD(&newclient->idlist); |
1734 | newclient->coredev = coredev; | 1729 | newclient->coredev = coredev; |
diff --git a/drivers/media/dvb-frontends/as102_fe.c b/drivers/media/dvb-frontends/as102_fe.c index 98d575f2744c..1fb4ab21d786 100644 --- a/drivers/media/dvb-frontends/as102_fe.c +++ b/drivers/media/dvb-frontends/as102_fe.c | |||
@@ -456,10 +456,9 @@ struct dvb_frontend *as102_attach(const char *name, | |||
456 | struct dvb_frontend *fe; | 456 | struct dvb_frontend *fe; |
457 | 457 | ||
458 | state = kzalloc(sizeof(struct as102_state), GFP_KERNEL); | 458 | state = kzalloc(sizeof(struct as102_state), GFP_KERNEL); |
459 | if (state == NULL) { | 459 | if (!state) |
460 | pr_err("%s: unable to allocate memory for state\n", __func__); | ||
461 | return NULL; | 460 | return NULL; |
462 | } | 461 | |
463 | fe = &state->frontend; | 462 | fe = &state->frontend; |
464 | fe->demodulator_priv = state; | 463 | fe->demodulator_priv = state; |
465 | state->ops = ops; | 464 | state->ops = ops; |
diff --git a/drivers/media/dvb-frontends/cx24113.c b/drivers/media/dvb-frontends/cx24113.c index 0118c2658cf7..8fc7333c76b7 100644 --- a/drivers/media/dvb-frontends/cx24113.c +++ b/drivers/media/dvb-frontends/cx24113.c | |||
@@ -555,10 +555,9 @@ struct dvb_frontend *cx24113_attach(struct dvb_frontend *fe, | |||
555 | struct cx24113_state *state = | 555 | struct cx24113_state *state = |
556 | kzalloc(sizeof(struct cx24113_state), GFP_KERNEL); | 556 | kzalloc(sizeof(struct cx24113_state), GFP_KERNEL); |
557 | int rc; | 557 | int rc; |
558 | if (state == NULL) { | 558 | |
559 | cx_err("Unable to kzalloc\n"); | 559 | if (!state) |
560 | goto error; | 560 | goto error; |
561 | } | ||
562 | 561 | ||
563 | /* setup the state */ | 562 | /* setup the state */ |
564 | state->config = config; | 563 | state->config = config; |
diff --git a/drivers/media/dvb-frontends/cx24116.c b/drivers/media/dvb-frontends/cx24116.c index e105532bfba8..96af4ffba0f9 100644 --- a/drivers/media/dvb-frontends/cx24116.c +++ b/drivers/media/dvb-frontends/cx24116.c | |||
@@ -227,7 +227,6 @@ static int cx24116_writeregN(struct cx24116_state *state, int reg, | |||
227 | 227 | ||
228 | buf = kmalloc(len + 1, GFP_KERNEL); | 228 | buf = kmalloc(len + 1, GFP_KERNEL); |
229 | if (buf == NULL) { | 229 | if (buf == NULL) { |
230 | printk("Unable to kmalloc\n"); | ||
231 | ret = -ENOMEM; | 230 | ret = -ENOMEM; |
232 | goto error; | 231 | goto error; |
233 | } | 232 | } |
diff --git a/drivers/media/dvb-frontends/drxd_hard.c b/drivers/media/dvb-frontends/drxd_hard.c index 7d04400b18dd..47b0d37e70ba 100644 --- a/drivers/media/dvb-frontends/drxd_hard.c +++ b/drivers/media/dvb-frontends/drxd_hard.c | |||
@@ -911,7 +911,6 @@ static int load_firmware(struct drxd_state *state, const char *fw_name) | |||
911 | state->microcode = kmemdup(fw->data, fw->size, GFP_KERNEL); | 911 | state->microcode = kmemdup(fw->data, fw->size, GFP_KERNEL); |
912 | if (state->microcode == NULL) { | 912 | if (state->microcode == NULL) { |
913 | release_firmware(fw); | 913 | release_firmware(fw); |
914 | printk(KERN_ERR "drxd: firmware load failure: no memory\n"); | ||
915 | return -ENOMEM; | 914 | return -ENOMEM; |
916 | } | 915 | } |
917 | 916 | ||
diff --git a/drivers/media/dvb-frontends/ds3000.c b/drivers/media/dvb-frontends/ds3000.c index 0b17a45c5640..c2959a9695a7 100644 --- a/drivers/media/dvb-frontends/ds3000.c +++ b/drivers/media/dvb-frontends/ds3000.c | |||
@@ -277,10 +277,8 @@ static int ds3000_writeFW(struct ds3000_state *state, int reg, | |||
277 | u8 *buf; | 277 | u8 *buf; |
278 | 278 | ||
279 | buf = kmalloc(33, GFP_KERNEL); | 279 | buf = kmalloc(33, GFP_KERNEL); |
280 | if (buf == NULL) { | 280 | if (!buf) |
281 | printk(KERN_ERR "Unable to kmalloc\n"); | ||
282 | return -ENOMEM; | 281 | return -ENOMEM; |
283 | } | ||
284 | 282 | ||
285 | *(buf) = reg; | 283 | *(buf) = reg; |
286 | 284 | ||
@@ -842,10 +840,8 @@ struct dvb_frontend *ds3000_attach(const struct ds3000_config *config, | |||
842 | 840 | ||
843 | /* allocate memory for the internal state */ | 841 | /* allocate memory for the internal state */ |
844 | state = kzalloc(sizeof(struct ds3000_state), GFP_KERNEL); | 842 | state = kzalloc(sizeof(struct ds3000_state), GFP_KERNEL); |
845 | if (state == NULL) { | 843 | if (!state) |
846 | printk(KERN_ERR "Unable to kmalloc\n"); | ||
847 | goto error2; | 844 | goto error2; |
848 | } | ||
849 | 845 | ||
850 | state->config = config; | 846 | state->config = config; |
851 | state->i2c = i2c; | 847 | state->i2c = i2c; |
diff --git a/drivers/media/dvb-frontends/mb86a20s.c b/drivers/media/dvb-frontends/mb86a20s.c index e8ac8c3e2ec0..340984100aec 100644 --- a/drivers/media/dvb-frontends/mb86a20s.c +++ b/drivers/media/dvb-frontends/mb86a20s.c | |||
@@ -2072,11 +2072,8 @@ struct dvb_frontend *mb86a20s_attach(const struct mb86a20s_config *config, | |||
2072 | 2072 | ||
2073 | /* allocate memory for the internal state */ | 2073 | /* allocate memory for the internal state */ |
2074 | state = kzalloc(sizeof(struct mb86a20s_state), GFP_KERNEL); | 2074 | state = kzalloc(sizeof(struct mb86a20s_state), GFP_KERNEL); |
2075 | if (state == NULL) { | 2075 | if (!state) |
2076 | dev_err(&i2c->dev, | ||
2077 | "%s: unable to allocate memory for state\n", __func__); | ||
2078 | goto error; | 2076 | goto error; |
2079 | } | ||
2080 | 2077 | ||
2081 | /* setup the state */ | 2078 | /* setup the state */ |
2082 | state->config = config; | 2079 | state->config = config; |
diff --git a/drivers/media/dvb-frontends/si2168.c b/drivers/media/dvb-frontends/si2168.c index 172fc367ccaa..41d9c513b7e8 100644 --- a/drivers/media/dvb-frontends/si2168.c +++ b/drivers/media/dvb-frontends/si2168.c | |||
@@ -696,7 +696,6 @@ static int si2168_probe(struct i2c_client *client, | |||
696 | dev = kzalloc(sizeof(*dev), GFP_KERNEL); | 696 | dev = kzalloc(sizeof(*dev), GFP_KERNEL); |
697 | if (!dev) { | 697 | if (!dev) { |
698 | ret = -ENOMEM; | 698 | ret = -ENOMEM; |
699 | dev_err(&client->dev, "kzalloc() failed\n"); | ||
700 | goto err; | 699 | goto err; |
701 | } | 700 | } |
702 | 701 | ||
diff --git a/drivers/media/dvb-frontends/sp2.c b/drivers/media/dvb-frontends/sp2.c index 43d47dfcc7b8..d3b4f8822096 100644 --- a/drivers/media/dvb-frontends/sp2.c +++ b/drivers/media/dvb-frontends/sp2.c | |||
@@ -384,7 +384,6 @@ static int sp2_probe(struct i2c_client *client, | |||
384 | s = kzalloc(sizeof(struct sp2), GFP_KERNEL); | 384 | s = kzalloc(sizeof(struct sp2), GFP_KERNEL); |
385 | if (!s) { | 385 | if (!s) { |
386 | ret = -ENOMEM; | 386 | ret = -ENOMEM; |
387 | dev_err(&client->dev, "kzalloc() failed\n"); | ||
388 | goto err; | 387 | goto err; |
389 | } | 388 | } |
390 | 389 | ||
diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c index f289b8aca1da..5217f9ad5e6b 100644 --- a/drivers/media/i2c/adv7604.c +++ b/drivers/media/i2c/adv7604.c | |||
@@ -3316,10 +3316,8 @@ static int adv76xx_probe(struct i2c_client *client, | |||
3316 | client->addr << 1); | 3316 | client->addr << 1); |
3317 | 3317 | ||
3318 | state = devm_kzalloc(&client->dev, sizeof(*state), GFP_KERNEL); | 3318 | state = devm_kzalloc(&client->dev, sizeof(*state), GFP_KERNEL); |
3319 | if (!state) { | 3319 | if (!state) |
3320 | v4l_err(client, "Could not allocate adv76xx_state memory!\n"); | ||
3321 | return -ENOMEM; | 3320 | return -ENOMEM; |
3322 | } | ||
3323 | 3321 | ||
3324 | state->i2c_clients[ADV76XX_PAGE_IO] = client; | 3322 | state->i2c_clients[ADV76XX_PAGE_IO] = client; |
3325 | 3323 | ||
diff --git a/drivers/media/i2c/adv7842.c b/drivers/media/i2c/adv7842.c index 65f34e7e146f..c582bcb782a6 100644 --- a/drivers/media/i2c/adv7842.c +++ b/drivers/media/i2c/adv7842.c | |||
@@ -3468,10 +3468,8 @@ static int adv7842_probe(struct i2c_client *client, | |||
3468 | } | 3468 | } |
3469 | 3469 | ||
3470 | state = devm_kzalloc(&client->dev, sizeof(struct adv7842_state), GFP_KERNEL); | 3470 | state = devm_kzalloc(&client->dev, sizeof(struct adv7842_state), GFP_KERNEL); |
3471 | if (!state) { | 3471 | if (!state) |
3472 | v4l_err(client, "Could not allocate adv7842_state memory!\n"); | ||
3473 | return -ENOMEM; | 3472 | return -ENOMEM; |
3474 | } | ||
3475 | 3473 | ||
3476 | /* platform data */ | 3474 | /* platform data */ |
3477 | state->pdata = *pdata; | 3475 | state->pdata = *pdata; |
diff --git a/drivers/media/pci/cx18/cx18-driver.c b/drivers/media/pci/cx18/cx18-driver.c index 8654710464cc..9e99c6ef1476 100644 --- a/drivers/media/pci/cx18/cx18-driver.c +++ b/drivers/media/pci/cx18/cx18-driver.c | |||
@@ -910,11 +910,9 @@ static int cx18_probe(struct pci_dev *pci_dev, | |||
910 | } | 910 | } |
911 | 911 | ||
912 | cx = kzalloc(sizeof(struct cx18), GFP_ATOMIC); | 912 | cx = kzalloc(sizeof(struct cx18), GFP_ATOMIC); |
913 | if (cx == NULL) { | 913 | if (!cx) |
914 | printk(KERN_ERR "cx18: cannot manage card %d, out of memory\n", | ||
915 | i); | ||
916 | return -ENOMEM; | 914 | return -ENOMEM; |
917 | } | 915 | |
918 | cx->pci_dev = pci_dev; | 916 | cx->pci_dev = pci_dev; |
919 | cx->instance = i; | 917 | cx->instance = i; |
920 | 918 | ||
diff --git a/drivers/media/pci/mantis/hopper_cards.c b/drivers/media/pci/mantis/hopper_cards.c index 11e987860b23..0c91df34ec67 100644 --- a/drivers/media/pci/mantis/hopper_cards.c +++ b/drivers/media/pci/mantis/hopper_cards.c | |||
@@ -165,7 +165,6 @@ static int hopper_pci_probe(struct pci_dev *pdev, | |||
165 | 165 | ||
166 | mantis = kzalloc(sizeof(struct mantis_pci), GFP_KERNEL); | 166 | mantis = kzalloc(sizeof(struct mantis_pci), GFP_KERNEL); |
167 | if (mantis == NULL) { | 167 | if (mantis == NULL) { |
168 | printk(KERN_ERR "%s ERROR: Out of memory\n", __func__); | ||
169 | err = -ENOMEM; | 168 | err = -ENOMEM; |
170 | goto fail0; | 169 | goto fail0; |
171 | } | 170 | } |
diff --git a/drivers/media/pci/mantis/mantis_cards.c b/drivers/media/pci/mantis/mantis_cards.c index adc980d33711..2dba030c7132 100644 --- a/drivers/media/pci/mantis/mantis_cards.c +++ b/drivers/media/pci/mantis/mantis_cards.c | |||
@@ -174,10 +174,8 @@ static int mantis_pci_probe(struct pci_dev *pdev, | |||
174 | int err = 0; | 174 | int err = 0; |
175 | 175 | ||
176 | mantis = kzalloc(sizeof(struct mantis_pci), GFP_KERNEL); | 176 | mantis = kzalloc(sizeof(struct mantis_pci), GFP_KERNEL); |
177 | if (mantis == NULL) { | 177 | if (!mantis) |
178 | printk(KERN_ERR "%s ERROR: Out of memory\n", __func__); | ||
179 | return -ENOMEM; | 178 | return -ENOMEM; |
180 | } | ||
181 | 179 | ||
182 | drvdata = (void *)pci_id->driver_data; | 180 | drvdata = (void *)pci_id->driver_data; |
183 | mantis->num = devs; | 181 | mantis->num = devs; |
diff --git a/drivers/media/pci/meye/meye.c b/drivers/media/pci/meye/meye.c index 49e047e4a81e..af9cd02fac0c 100644 --- a/drivers/media/pci/meye/meye.c +++ b/drivers/media/pci/meye/meye.c | |||
@@ -1626,23 +1626,18 @@ static int meye_probe(struct pci_dev *pcidev, const struct pci_device_id *ent) | |||
1626 | meye.mchip_dev = pcidev; | 1626 | meye.mchip_dev = pcidev; |
1627 | 1627 | ||
1628 | meye.grab_temp = vmalloc(MCHIP_NB_PAGES_MJPEG * PAGE_SIZE); | 1628 | meye.grab_temp = vmalloc(MCHIP_NB_PAGES_MJPEG * PAGE_SIZE); |
1629 | if (!meye.grab_temp) { | 1629 | if (!meye.grab_temp) |
1630 | v4l2_err(v4l2_dev, "grab buffer allocation failed\n"); | ||
1631 | goto outvmalloc; | 1630 | goto outvmalloc; |
1632 | } | ||
1633 | 1631 | ||
1634 | spin_lock_init(&meye.grabq_lock); | 1632 | spin_lock_init(&meye.grabq_lock); |
1635 | if (kfifo_alloc(&meye.grabq, sizeof(int) * MEYE_MAX_BUFNBRS, | 1633 | if (kfifo_alloc(&meye.grabq, sizeof(int) * MEYE_MAX_BUFNBRS, |
1636 | GFP_KERNEL)) { | 1634 | GFP_KERNEL)) |
1637 | v4l2_err(v4l2_dev, "fifo allocation failed\n"); | ||
1638 | goto outkfifoalloc1; | 1635 | goto outkfifoalloc1; |
1639 | } | 1636 | |
1640 | spin_lock_init(&meye.doneq_lock); | 1637 | spin_lock_init(&meye.doneq_lock); |
1641 | if (kfifo_alloc(&meye.doneq, sizeof(int) * MEYE_MAX_BUFNBRS, | 1638 | if (kfifo_alloc(&meye.doneq, sizeof(int) * MEYE_MAX_BUFNBRS, |
1642 | GFP_KERNEL)) { | 1639 | GFP_KERNEL)) |
1643 | v4l2_err(v4l2_dev, "fifo allocation failed\n"); | ||
1644 | goto outkfifoalloc2; | 1640 | goto outkfifoalloc2; |
1645 | } | ||
1646 | 1641 | ||
1647 | meye.vdev = meye_template; | 1642 | meye.vdev = meye_template; |
1648 | meye.vdev.v4l2_dev = &meye.v4l2_dev; | 1643 | meye.vdev.v4l2_dev = &meye.v4l2_dev; |
diff --git a/drivers/media/pci/saa7146/hexium_gemini.c b/drivers/media/pci/saa7146/hexium_gemini.c index f708cab01fef..32c19bad9a17 100644 --- a/drivers/media/pci/saa7146/hexium_gemini.c +++ b/drivers/media/pci/saa7146/hexium_gemini.c | |||
@@ -261,10 +261,9 @@ static int hexium_attach(struct saa7146_dev *dev, struct saa7146_pci_extension_d | |||
261 | DEB_EE("\n"); | 261 | DEB_EE("\n"); |
262 | 262 | ||
263 | hexium = kzalloc(sizeof(struct hexium), GFP_KERNEL); | 263 | hexium = kzalloc(sizeof(struct hexium), GFP_KERNEL); |
264 | if (NULL == hexium) { | 264 | if (!hexium) |
265 | pr_err("not enough kernel memory in hexium_attach()\n"); | ||
266 | return -ENOMEM; | 265 | return -ENOMEM; |
267 | } | 266 | |
268 | dev->ext_priv = hexium; | 267 | dev->ext_priv = hexium; |
269 | 268 | ||
270 | /* enable i2c-port pins */ | 269 | /* enable i2c-port pins */ |
diff --git a/drivers/media/pci/saa7146/hexium_orion.c b/drivers/media/pci/saa7146/hexium_orion.c index 01f01580c7ca..8d1dc8eea988 100644 --- a/drivers/media/pci/saa7146/hexium_orion.c +++ b/drivers/media/pci/saa7146/hexium_orion.c | |||
@@ -220,10 +220,8 @@ static int hexium_probe(struct saa7146_dev *dev) | |||
220 | } | 220 | } |
221 | 221 | ||
222 | hexium = kzalloc(sizeof(struct hexium), GFP_KERNEL); | 222 | hexium = kzalloc(sizeof(struct hexium), GFP_KERNEL); |
223 | if (NULL == hexium) { | 223 | if (!hexium) |
224 | pr_err("hexium_probe: not enough kernel memory\n"); | ||
225 | return -ENOMEM; | 224 | return -ENOMEM; |
226 | } | ||
227 | 225 | ||
228 | /* enable i2c-port pins */ | 226 | /* enable i2c-port pins */ |
229 | saa7146_write(dev, MC1, (MASK_08 | MASK_24 | MASK_10 | MASK_26)); | 227 | saa7146_write(dev, MC1, (MASK_08 | MASK_24 | MASK_10 | MASK_26)); |
diff --git a/drivers/media/pci/saa7164/saa7164-buffer.c b/drivers/media/pci/saa7164/saa7164-buffer.c index a0d2129c6ca9..6bd665ea190d 100644 --- a/drivers/media/pci/saa7164/saa7164-buffer.c +++ b/drivers/media/pci/saa7164/saa7164-buffer.c | |||
@@ -99,10 +99,8 @@ struct saa7164_buffer *saa7164_buffer_alloc(struct saa7164_port *port, | |||
99 | } | 99 | } |
100 | 100 | ||
101 | buf = kzalloc(sizeof(struct saa7164_buffer), GFP_KERNEL); | 101 | buf = kzalloc(sizeof(struct saa7164_buffer), GFP_KERNEL); |
102 | if (!buf) { | 102 | if (!buf) |
103 | log_warn("%s() SAA_ERR_NO_RESOURCES\n", __func__); | ||
104 | goto ret; | 103 | goto ret; |
105 | } | ||
106 | 104 | ||
107 | buf->idx = -1; | 105 | buf->idx = -1; |
108 | buf->port = port; | 106 | buf->port = port; |
diff --git a/drivers/media/platform/atmel/atmel-isc.c b/drivers/media/platform/atmel/atmel-isc.c index d7103c5f92c3..db410c558a74 100644 --- a/drivers/media/platform/atmel/atmel-isc.c +++ b/drivers/media/platform/atmel/atmel-isc.c | |||
@@ -1507,10 +1507,8 @@ static int isc_formats_init(struct isc_device *isc) | |||
1507 | isc->user_formats = devm_kcalloc(isc->dev, | 1507 | isc->user_formats = devm_kcalloc(isc->dev, |
1508 | num_fmts, sizeof(struct isc_format *), | 1508 | num_fmts, sizeof(struct isc_format *), |
1509 | GFP_KERNEL); | 1509 | GFP_KERNEL); |
1510 | if (!isc->user_formats) { | 1510 | if (!isc->user_formats) |
1511 | v4l2_err(&isc->v4l2_dev, "could not allocate memory\n"); | ||
1512 | return -ENOMEM; | 1511 | return -ENOMEM; |
1513 | } | ||
1514 | 1512 | ||
1515 | fmt = &isc_formats[0]; | 1513 | fmt = &isc_formats[0]; |
1516 | for (i = 0, j = 0; i < ARRAY_SIZE(isc_formats); i++) { | 1514 | for (i = 0, j = 0; i < ARRAY_SIZE(isc_formats); i++) { |
diff --git a/drivers/media/platform/atmel/atmel-isi.c b/drivers/media/platform/atmel/atmel-isi.c index 891fa2505efa..154e9c39b64f 100644 --- a/drivers/media/platform/atmel/atmel-isi.c +++ b/drivers/media/platform/atmel/atmel-isi.c | |||
@@ -1038,10 +1038,8 @@ static int isi_formats_init(struct atmel_isi *isi) | |||
1038 | isi->user_formats = devm_kcalloc(isi->dev, | 1038 | isi->user_formats = devm_kcalloc(isi->dev, |
1039 | num_fmts, sizeof(struct isi_format *), | 1039 | num_fmts, sizeof(struct isi_format *), |
1040 | GFP_KERNEL); | 1040 | GFP_KERNEL); |
1041 | if (!isi->user_formats) { | 1041 | if (!isi->user_formats) |
1042 | dev_err(isi->dev, "could not allocate memory\n"); | ||
1043 | return -ENOMEM; | 1042 | return -ENOMEM; |
1044 | } | ||
1045 | 1043 | ||
1046 | memcpy(isi->user_formats, isi_fmts, | 1044 | memcpy(isi->user_formats, isi_fmts, |
1047 | num_fmts * sizeof(struct isi_format *)); | 1045 | num_fmts * sizeof(struct isi_format *)); |
@@ -1176,10 +1174,8 @@ static int atmel_isi_probe(struct platform_device *pdev) | |||
1176 | int ret, i; | 1174 | int ret, i; |
1177 | 1175 | ||
1178 | isi = devm_kzalloc(&pdev->dev, sizeof(struct atmel_isi), GFP_KERNEL); | 1176 | isi = devm_kzalloc(&pdev->dev, sizeof(struct atmel_isi), GFP_KERNEL); |
1179 | if (!isi) { | 1177 | if (!isi) |
1180 | dev_err(&pdev->dev, "Can't allocate interface!\n"); | ||
1181 | return -ENOMEM; | 1178 | return -ENOMEM; |
1182 | } | ||
1183 | 1179 | ||
1184 | isi->pclk = devm_clk_get(&pdev->dev, "isi_clk"); | 1180 | isi->pclk = devm_clk_get(&pdev->dev, "isi_clk"); |
1185 | if (IS_ERR(isi->pclk)) | 1181 | if (IS_ERR(isi->pclk)) |
diff --git a/drivers/media/platform/blackfin/ppi.c b/drivers/media/platform/blackfin/ppi.c index 37169054b828..478eb2f7d723 100644 --- a/drivers/media/platform/blackfin/ppi.c +++ b/drivers/media/platform/blackfin/ppi.c | |||
@@ -338,7 +338,6 @@ struct ppi_if *ppi_create_instance(struct platform_device *pdev, | |||
338 | ppi = kzalloc(sizeof(*ppi), GFP_KERNEL); | 338 | ppi = kzalloc(sizeof(*ppi), GFP_KERNEL); |
339 | if (!ppi) { | 339 | if (!ppi) { |
340 | peripheral_free_list(info->pin_req); | 340 | peripheral_free_list(info->pin_req); |
341 | dev_err(&pdev->dev, "unable to allocate memory for ppi handle\n"); | ||
342 | return NULL; | 341 | return NULL; |
343 | } | 342 | } |
344 | ppi->ops = &ppi_ops; | 343 | ppi->ops = &ppi_ops; |
diff --git a/drivers/media/usb/zr364xx/zr364xx.c b/drivers/media/usb/zr364xx/zr364xx.c index 4ff8d0aed015..b50cff4ef9eb 100644 --- a/drivers/media/usb/zr364xx/zr364xx.c +++ b/drivers/media/usb/zr364xx/zr364xx.c | |||
@@ -209,10 +209,8 @@ static int send_control_msg(struct usb_device *udev, u8 request, u16 value, | |||
209 | int status; | 209 | int status; |
210 | 210 | ||
211 | unsigned char *transfer_buffer = kmalloc(size, GFP_KERNEL); | 211 | unsigned char *transfer_buffer = kmalloc(size, GFP_KERNEL); |
212 | if (!transfer_buffer) { | 212 | if (!transfer_buffer) |
213 | dev_err(&udev->dev, "kmalloc(%d) failed\n", size); | ||
214 | return -ENOMEM; | 213 | return -ENOMEM; |
215 | } | ||
216 | 214 | ||
217 | memcpy(transfer_buffer, cp, size); | 215 | memcpy(transfer_buffer, cp, size); |
218 | 216 | ||
@@ -1424,10 +1422,8 @@ static int zr364xx_probe(struct usb_interface *intf, | |||
1424 | le16_to_cpu(udev->descriptor.idProduct)); | 1422 | le16_to_cpu(udev->descriptor.idProduct)); |
1425 | 1423 | ||
1426 | cam = kzalloc(sizeof(struct zr364xx_camera), GFP_KERNEL); | 1424 | cam = kzalloc(sizeof(struct zr364xx_camera), GFP_KERNEL); |
1427 | if (cam == NULL) { | 1425 | if (!cam) |
1428 | dev_err(&udev->dev, "cam: out of memory !\n"); | ||
1429 | return -ENOMEM; | 1426 | return -ENOMEM; |
1430 | } | ||
1431 | 1427 | ||
1432 | cam->v4l2_dev.release = zr364xx_release; | 1428 | cam->v4l2_dev.release = zr364xx_release; |
1433 | err = v4l2_device_register(&intf->dev, &cam->v4l2_dev); | 1429 | err = v4l2_device_register(&intf->dev, &cam->v4l2_dev); |