Correct error handling and add error message in ustcmd.c
authorNils Carlson <nils.carlson@ericsson.com>
Fri, 10 Sep 2010 11:28:29 +0000 (13:28 +0200)
committerNils Carlson <nils.carlson@ericsson.com>
Mon, 13 Sep 2010 11:55:48 +0000 (13:55 +0200)
Signed-off-by: Nils Carlson <nils.carlson@ericsson.com>
Acked-by: Douglas Santos <douglas.santos@polymtl.ca>
libustcmd/ustcmd.c

index 4248072b4705d0ca384982dcbd1acb2a68f4b01e..c51232000310340d81144ed8e6607c412a6b405a 100644 (file)
@@ -395,10 +395,6 @@ int ustcmd_get_cmsf(struct marker_status **cmsf, const pid_t pid)
                return -1;
        }
        result = ustcmd_send_cmd("list_markers", pid, &big_str);
-       if (result != 1) {
-               return -1;
-       }
-
        if (result != 1) {
                ERR("error while getting markers list");
                return -1;
@@ -407,6 +403,7 @@ int ustcmd_get_cmsf(struct marker_status **cmsf, const pid_t pid)
        tmp_cmsf = (struct marker_status *) malloc(sizeof(struct marker_status) *
                (ustcmd_count_nl(big_str) + 1));
        if (tmp_cmsf == NULL) {
+               ERR("Failed to allocate CMSF array");
                return -1;
        }
 
This page took 0.024065 seconds and 4 git commands to generate.