summaryrefslogtreecommitdiffstats
path: root/src/machine/image-dbus.c
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2022-08-09 14:35:15 +0200
committerDavid Tardon <dtardon@redhat.com>2022-09-13 08:13:27 +0200
commit995340074e554b4bf4a0fdb0cb7436692c5a4ffd (patch)
treeca3ee001db3e608ee80478f42fea9c3b409f1b7b /src/machine/image-dbus.c
parentMerge pull request #23087 from yuwata/udev-watch (diff)
downloadsystemd-995340074e554b4bf4a0fdb0cb7436692c5a4ffd.tar.xz
systemd-995340074e554b4bf4a0fdb0cb7436692c5a4ffd.zip
tree-wide: use ASSERT_PTR more
Diffstat (limited to 'src/machine/image-dbus.c')
-rw-r--r--src/machine/image-dbus.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/machine/image-dbus.c b/src/machine/image-dbus.c
index 1ff1869720..84dc95eca1 100644
--- a/src/machine/image-dbus.c
+++ b/src/machine/image-dbus.c
@@ -32,13 +32,12 @@ int bus_image_method_remove(
sd_bus_error *error) {
_cleanup_close_pair_ int errno_pipe_fd[2] = { -1, -1 };
- Image *image = userdata;
+ Image *image = ASSERT_PTR(userdata);
Manager *m = image->userdata;
pid_t child;
int r;
assert(message);
- assert(image);
if (m->n_operations >= OPERATIONS_MAX)
return sd_bus_error_set(error, SD_BUS_ERROR_LIMITS_EXCEEDED, "Too many ongoing operations.");
@@ -99,13 +98,12 @@ int bus_image_method_rename(
void *userdata,
sd_bus_error *error) {
- Image *image = userdata;
+ Image *image = ASSERT_PTR(userdata);
Manager *m = image->userdata;
const char *new_name;
int r;
assert(message);
- assert(image);
r = sd_bus_message_read(message, "s", &new_name);
if (r < 0)
@@ -148,15 +146,13 @@ int bus_image_method_clone(
sd_bus_error *error) {
_cleanup_close_pair_ int errno_pipe_fd[2] = { -1, -1 };
- Image *image = userdata;
- Manager *m = image->userdata;
+ Image *image = ASSERT_PTR(userdata);
+ Manager *m = ASSERT_PTR(image->userdata);
const char *new_name;
int r, read_only;
pid_t child;
assert(message);
- assert(image);
- assert(m);
if (m->n_operations >= OPERATIONS_MAX)
return sd_bus_error_set(error, SD_BUS_ERROR_LIMITS_EXCEEDED, "Too many ongoing operations.");
@@ -389,10 +385,9 @@ int bus_image_method_get_os_release(
}
static int image_flush_cache(sd_event_source *s, void *userdata) {
- Manager *m = userdata;
+ Manager *m = ASSERT_PTR(userdata);
assert(s);
- assert(m);
hashmap_clear(m->image_cache);
return 0;