aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/media/common/siano
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2017-08-28 05:46:57 -0400
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-09-23 08:19:55 -0400
commitc38e8657a471e9af42b86009e5d3085031b41fda (patch)
treeb2bb818ff8b099ee5237da0ab3b9db680b520a0b /drivers/media/common/siano
parentmedia: tc358743: add CEC support (diff)
downloadwireguard-linux-c38e8657a471e9af42b86009e5d3085031b41fda.tar.xz
wireguard-linux-c38e8657a471e9af42b86009e5d3085031b41fda.zip
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/common/siano')
-rw-r--r--drivers/media/common/siano/smscoreapi.c13
1 files changed, 4 insertions, 9 deletions
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)
buffer = kmalloc(sizeof(struct sms_msg_data) +
SMS_DMA_ALIGNMENT, GFP_KERNEL | GFP_DMA);
- if (!buffer) {
- pr_err("Could not allocate buffer for init device message.\n");
+ if (!buffer)
return -ENOMEM;
- }
msg = (struct sms_msg_data *)SMS_ALIGN_ADDRESS(buffer);
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,
return -EEXIST;
}
listentry = kzalloc(sizeof(struct smscore_idlist_t), GFP_KERNEL);
- if (!listentry) {
- pr_err("Can't allocate memory for client id.\n");
+ if (!listentry)
return -ENOMEM;
- }
+
listentry->id = id;
listentry->data_type = data_type;
list_add_locked(&listentry->entry, &client->idlist,
@@ -1725,10 +1722,8 @@ int smscore_register_client(struct smscore_device_t *coredev,
}
newclient = kzalloc(sizeof(struct smscore_client_t), GFP_KERNEL);
- if (!newclient) {
- pr_err("Failed to allocate memory for client.\n");
+ if (!newclient)
return -ENOMEM;
- }
INIT_LIST_HEAD(&newclient->idlist);
newclient->coredev = coredev;