Skip to contentSkip to conversation

LVM2/libdm libdm-config.c

PATCH [email protected] 1 participant 1 message Sep 25, 2011

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: zkabelac at sourceware.org 2011-09-25 19:45:40

Modified files:
libdm : libdm-config.c

Log message:
Remove test for NULL

Since it's internal function and we always check for NULL value before call - this is safe.

Just for case add nonnull attribute so analyzer might better catch error.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdm-config.c.diff?cvsroot=lvm2&r1=1.12&r2=1.13

libdm/libdm-config.c +1 -3
@@ -1225,14 +1225,12 @@
 		return 0;
 }
 
+__attribute__((nonnull(1, 2)))
 static struct dm_config_value *_clone_config_value(struct dm_pool *mem,
 						   const struct dm_config_value *v)
 {
 	struct dm_config_value *new_cv;
 
-	if (!v)
-		return NULL;
-
 	if (!(new_cv = _create_value(mem))) {
 		log_error("Failed to clone config value.");
 		return NULL;