summaryrefslogtreecommitdiff
path: root/drivers/target
diff options
context:
space:
mode:
authorNicholas Bellinger <nab@linux-iscsi.org>2014-10-02 10:01:15 +0400
committerNicholas Bellinger <nab@linux-iscsi.org>2014-10-03 22:16:11 +0400
commit6e14eab90a933c2e936639be390bf231a377b44a (patch)
tree75af24e220d7b5104e24025a84c069fd183304bf /drivers/target
parent7c9e7a6fe11c8dc5b3b9d0e889dde73347247584 (diff)
downloadlinux-6e14eab90a933c2e936639be390bf231a377b44a.tar.xz
target/user: Fix up smatch warnings in tcmu_netlink_event
This patch fixes up the following unused return smatch warnings: drivers/target/target_core_user.c:778 tcmu_netlink_event warn: unused return: ret = nla_put_string() drivers/target/target_core_user.c:780 tcmu_netlink_event warn: unused `return: ret = nla_put_u32() (Fix up missing semicolon: grover) Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target')
-rw-r--r--drivers/target/target_core_user.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c
index 6608ecf94570..ac37ce6be15c 100644
--- a/drivers/target/target_core_user.c
+++ b/drivers/target/target_core_user.c
@@ -763,27 +763,27 @@ static int tcmu_netlink_event(enum tcmu_genl_cmd cmd, const char *name, int mino
{
struct sk_buff *skb;
void *msg_header;
- int ret;
+ int ret = -ENOMEM;
skb = genlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL);
if (!skb)
- return -ENOMEM;
+ return ret;
msg_header = genlmsg_put(skb, 0, 0, &tcmu_genl_family, 0, cmd);
- if (!msg_header) {
- nlmsg_free(skb);
- return -ENOMEM;
- }
+ if (!msg_header)
+ goto free_skb;
ret = nla_put_string(skb, TCMU_ATTR_DEVICE, name);
+ if (ret < 0)
+ goto free_skb;
ret = nla_put_u32(skb, TCMU_ATTR_MINOR, minor);
+ if (ret < 0)
+ goto free_skb;
ret = genlmsg_end(skb, msg_header);
- if (ret < 0) {
- nlmsg_free(skb);
- return ret;
- }
+ if (ret < 0)
+ goto free_skb;
ret = genlmsg_multicast(&tcmu_genl_family, skb, 0,
TCMU_MCGRP_CONFIG, GFP_KERNEL);
@@ -793,6 +793,9 @@ static int tcmu_netlink_event(enum tcmu_genl_cmd cmd, const char *name, int mino
ret = 0;
return ret;
+free_skb:
+ nlmsg_free(skb);
+ return ret;
}
static int tcmu_configure_device(struct se_device *dev)