Skip to contentSkip to conversation

coresight: perf: Add a missing call to etm_free_aux

PATCH Applied Quentin Lambert 2 participants 4 messages Nov 19, 2016 – Nov 21, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 coresight: perf: Add a missing call to etm_free_aux

Most error branches following the call to alloc_event_data contain a call to etm_free_aux. This patch add a call to etm_free_aux to an error branch that does not call it.

This issue was found with Hector.

---
 drivers/hwtracing/coresight/coresight-etm-perf.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwtracing/coresight/coresight-etm-perf.c +1 -1
@@ -215,7 +215,7 @@ static void *etm_setup_aux(int event_cpu
 	 */
 	sink = coresight_get_enabled_sink(true);
 	if (!sink)
-		return NULL;
+		goto err;
 
 	INIT_WORK(&event_data->work, free_event_data);
 
#1 lore raw
Quoted 14 lines · Quentin Lambert

Most error branches following the call to alloc_event_data contain a call to etm_free_aux. This patch add a call to etm_free_aux to an error branch that does not call it.

This issue was found with Hector.

---
  drivers/hwtracing/coresight/coresight-etm-perf.c |    2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

drivers/hwtracing/coresight/coresight-etm-perf.c static void *etm_setup_aux(int event_cpu · line 221

Quoted 8 lines
drivers/hwtracing/coresight/coresight-etm-perf.c +1 -1
@@ -215,7 +215,7 @@ static void *etm_setup_aux(int event_cpu
  	 */
  	sink = coresight_get_enabled_sink(true);
  	if (!sink)
-		return NULL;
+		goto err;
 
  	INIT_WORK(&event_data->work, free_event_data);
 

I realized that I hadn't try to compile after having sent this patch and I wasn't able to compile it.
Therefore, please ignore it for now.

Quentin

#2 lore raw
Quoted 14 lines · Quentin Lambert
Quoted 12 lines · Quentin Lambert

Most error branches following the call to alloc_event_data contain a call to
etm_free_aux. This patch add a call to etm_free_aux to an error branch that does not call it.

This issue was found with Hector.

---
  drivers/hwtracing/coresight/coresight-etm-perf.c |    2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 12 lines

drivers/hwtracing/coresight/coresight-etm-perf.c static void *etm_setup_aux(int event_cpu · line 219

Quoted 9 lines
drivers/hwtracing/coresight/coresight-etm-perf.c +1 -1
@@ -215,7 +215,7 @@ static void *etm_setup_aux(int event_cpu
       */
      sink = coresight_get_enabled_sink(true);
      if (!sink)
-        return NULL;
+        goto err;
        INIT_WORK(&event_data->work, free_event_data);

I realized that I hadn't try to compile after having sent this patch and I wasn't able to compile it.
Therefore, please ignore it for now.

I have just confirmed that it compiles.

Quentin

#3 lore raw
In reply to Quentin Lambert
Quoted 14 lines · Quentin Lambert

Most error branches following the call to alloc_event_data contain a call to etm_free_aux. This patch add a call to etm_free_aux to an error branch that does not call it.

This issue was found with Hector.

---
 drivers/hwtracing/coresight/coresight-etm-perf.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

drivers/hwtracing/coresight/coresight-etm-perf.c static void *etm_setup_aux(int event_cpu · line 221

Quoted 8 lines
drivers/hwtracing/coresight/coresight-etm-perf.c +1 -1
@@ -215,7 +215,7 @@ static void *etm_setup_aux(int event_cpu
 	 */
 	sink = coresight_get_enabled_sink(true);
 	if (!sink)
-		return NULL;
+		goto err;
 
 	INIT_WORK(&event_data->work, free_event_data);
 

Applied, after wrapping the commit log to 75 characters or less. Please run checkpatch.pl on your next submission and compiling your work before sending a patches is highly suggested.

Thanks,
Mathieu