summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2015-08-12 15:19:23 +0200
committerTom Gundersen <teg@jklm.no>2015-08-12 15:19:23 +0200
commit02d0f8a8a52297da2d77f80e2f32a7e233fd8c21 (patch)
tree4522038e07320dae3cbddcd9f71bd1e9e424a3a0 /src
parentf19121bbaecb6d481081850ed491e8e84a2bac21 (diff)
parenta592ab6ae891ceb63c7115257a0de0c6c45a2f42 (diff)
Merge pull request #939 from karelzak/smatch
treewide: trivial issues detected by smatch
Diffstat (limited to 'src')
-rw-r--r--src/boot/bootctl.c2
-rw-r--r--src/libsystemd/sd-netlink/netlink-message.c2
-rw-r--r--src/udev/udev-ctrl.c3
3 files changed, 4 insertions, 3 deletions
diff --git a/src/boot/bootctl.c b/src/boot/bootctl.c
index 359fde9998..ac1711b318 100644
--- a/src/boot/bootctl.c
+++ b/src/boot/bootctl.c
@@ -818,7 +818,7 @@ static int remove_boot_efi(const char *esp_path) {
if (r < 0)
return log_error_errno(errno, "Failed to remove \"%s/%s\": %m", p, de->d_name);
- log_info("Removed \"%s/\%s\".", p, de->d_name);
+ log_info("Removed \"%s/%s\".", p, de->d_name);
}
c++;
diff --git a/src/libsystemd/sd-netlink/netlink-message.c b/src/libsystemd/sd-netlink/netlink-message.c
index 3ba62a6be9..aee2ced2d9 100644
--- a/src/libsystemd/sd-netlink/netlink-message.c
+++ b/src/libsystemd/sd-netlink/netlink-message.c
@@ -501,7 +501,7 @@ static int netlink_message_read_internal(sd_netlink_message *m, unsigned short t
assert_return(m, -EINVAL);
assert_return(m->sealed, -EPERM);
assert_return(data, -EINVAL);
- assert(m->n_containers <= RTNL_CONTAINER_DEPTH);
+ assert(m->n_containers < RTNL_CONTAINER_DEPTH);
assert(m->containers[m->n_containers].attributes);
assert(type < m->containers[m->n_containers].n_attributes);
diff --git a/src/udev/udev-ctrl.c b/src/udev/udev-ctrl.c
index b0ad277f73..b4ae0944eb 100644
--- a/src/udev/udev-ctrl.c
+++ b/src/udev/udev-ctrl.c
@@ -379,13 +379,14 @@ struct udev_ctrl_msg *udev_ctrl_receive_msg(struct udev_ctrl_connection *conn) {
cmsg_close_all(&smsg);
cmsg = CMSG_FIRSTHDR(&smsg);
- cred = (struct ucred *) CMSG_DATA(cmsg);
if (cmsg == NULL || cmsg->cmsg_type != SCM_CREDENTIALS) {
log_error("no sender credentials received, message ignored");
goto err;
}
+ cred = (struct ucred *) CMSG_DATA(cmsg);
+
if (cred->uid != 0) {
log_error("sender uid="UID_FMT", message ignored", cred->uid);
goto err;