fio2gnuplot: Don't plot fake data
[fio.git] / diskutil.c
index 3681dde5d8cedb8190e4dcbd61f60274bba76179..e29d1c34af24d116f9a601437adb798a8ec194cf 100644 (file)
@@ -281,6 +281,11 @@ static struct disk_util *disk_util_add(struct thread_data *td, int majdev,
        dprint(FD_DISKUTIL, "add maj/min %d/%d: %s\n", majdev, mindev, path);
 
        du = smalloc(sizeof(*du));
+       if (!du) {
+               log_err("fio: smalloc() pool exhausted\n");
+               return NULL;
+       }
+
        memset(du, 0, sizeof(*du));
        INIT_FLIST_HEAD(&du->list);
        l = snprintf(du->path, sizeof(du->path), "%s/stat", path);