diff options
author | Markus Elfring <elfring@users.sourceforge.net> | 2017-08-28 12:46:57 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-09-23 15:19:55 +0300 |
commit | c38e8657a471e9af42b86009e5d3085031b41fda (patch) | |
tree | b2bb818ff8b099ee5237da0ab3b9db680b520a0b /drivers/media/dvb-frontends | |
parent | a0ec8d1dc42e4255307cb1b95345c01c327a10a6 (diff) | |
download | linux-c38e8657a471e9af42b86009e5d3085031b41fda.tar.xz |
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>
Diffstat (limited to 'drivers/media/dvb-frontends')
-rw-r--r-- | drivers/media/dvb-frontends/as102_fe.c | 5 | ||||
-rw-r--r-- | drivers/media/dvb-frontends/cx24113.c | 5 | ||||
-rw-r--r-- | drivers/media/dvb-frontends/cx24116.c | 1 | ||||
-rw-r--r-- | drivers/media/dvb-frontends/drxd_hard.c | 1 | ||||
-rw-r--r-- | drivers/media/dvb-frontends/ds3000.c | 8 | ||||
-rw-r--r-- | drivers/media/dvb-frontends/mb86a20s.c | 5 | ||||
-rw-r--r-- | drivers/media/dvb-frontends/si2168.c | 1 | ||||
-rw-r--r-- | drivers/media/dvb-frontends/sp2.c | 1 |
8 files changed, 7 insertions, 20 deletions
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, struct dvb_frontend *fe; state = kzalloc(sizeof(struct as102_state), GFP_KERNEL); - if (state == NULL) { - pr_err("%s: unable to allocate memory for state\n", __func__); + if (!state) return NULL; - } + fe = &state->frontend; fe->demodulator_priv = state; 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, struct cx24113_state *state = kzalloc(sizeof(struct cx24113_state), GFP_KERNEL); int rc; - if (state == NULL) { - cx_err("Unable to kzalloc\n"); + + if (!state) goto error; - } /* setup the state */ 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, buf = kmalloc(len + 1, GFP_KERNEL); if (buf == NULL) { - printk("Unable to kmalloc\n"); ret = -ENOMEM; goto error; } 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) state->microcode = kmemdup(fw->data, fw->size, GFP_KERNEL); if (state->microcode == NULL) { release_firmware(fw); - printk(KERN_ERR "drxd: firmware load failure: no memory\n"); return -ENOMEM; } 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, u8 *buf; buf = kmalloc(33, GFP_KERNEL); - if (buf == NULL) { - printk(KERN_ERR "Unable to kmalloc\n"); + if (!buf) return -ENOMEM; - } *(buf) = reg; @@ -842,10 +840,8 @@ struct dvb_frontend *ds3000_attach(const struct ds3000_config *config, /* allocate memory for the internal state */ state = kzalloc(sizeof(struct ds3000_state), GFP_KERNEL); - if (state == NULL) { - printk(KERN_ERR "Unable to kmalloc\n"); + if (!state) goto error2; - } state->config = config; 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, /* allocate memory for the internal state */ state = kzalloc(sizeof(struct mb86a20s_state), GFP_KERNEL); - if (state == NULL) { - dev_err(&i2c->dev, - "%s: unable to allocate memory for state\n", __func__); + if (!state) goto error; - } /* setup the state */ 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, dev = kzalloc(sizeof(*dev), GFP_KERNEL); if (!dev) { ret = -ENOMEM; - dev_err(&client->dev, "kzalloc() failed\n"); goto err; } 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, s = kzalloc(sizeof(struct sp2), GFP_KERNEL); if (!s) { ret = -ENOMEM; - dev_err(&client->dev, "kzalloc() failed\n"); goto err; } |