diff mbox series

swuforwarder: fix coverity #488018

Message ID 20240315091842.457274-1-stefano.babic@swupdate.org
State Accepted
Headers show
Series swuforwarder: fix coverity #488018 | expand

Commit Message

Stefano Babic March 15, 2024, 9:18 a.m. UTC
Signed-off-by: Stefano Babic <stefano.babic@swupdate.org>
---
 handlers/swuforward_handler.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--
2.34.1

Comments

Dominique MARTINET March 18, 2024, 1:28 a.m. UTC | #1
Stefano Babic wrote on Fri, Mar 15, 2024 at 10:18:42AM +0100:
> Subject: Re: [swupdate] [PATCH] swuforwarder: fix coverity #488018

Just a nitpick but it'd probably be better to have the subject describe
what's done instead of an arbitrary number like this (e.g. "also reset
connections list on error")

At previous job I'd mark coverity fixes as 'Reported-by: coverity' (or
perhaps 'Fixes: coverity#488018') if that helps with your triage.

(Looks like the commit has already been pushed to master though, so
that'll be for next ones and I also won't bother spelling out a
reviewed-by -- I'm not replying often but I am looking at most patches
at least superficially so it'd be great if you could leave one business
day between submission and pushing... This patch itself looks good to
me)
Stefano Babic March 18, 2024, 9:30 a.m. UTC | #2
Hi Dominique,

On 18.03.24 02:28, Dominique MARTINET wrote:
> Stefano Babic wrote on Fri, Mar 15, 2024 at 10:18:42AM +0100:
>> Subject: Re: [swupdate] [PATCH] swuforwarder: fix coverity #488018
>
> Just a nitpick but it'd probably be better to have the subject describe
> what's done instead of an arbitrary number like this (e.g. "also reset
> connections list on error")

Sure.

>
> At previous job I'd mark coverity fixes as 'Reported-by: coverity' (or
> perhaps 'Fixes: coverity#488018') if that helps with your triage.

Agree.

>
> (Looks like the commit has already been pushed to master though,

The patch itself is quite self explaining (again: the commit message
isn't), so I simply merged without to many thoughts. I will wait more
time in future.

> so
> that'll be for next ones and I also won't bother spelling out a
> reviewed-by -- I'm not replying often but I am looking at most patches
> at least superficially so it'd be great if you could leave one business
> day between submission and pushing... This patch itself looks good to
> me)

Fully agree - noted for next time.

Thanks,
Stefano
diff mbox series

Patch

diff --git a/handlers/swuforward_handler.c b/handlers/swuforward_handler.c
index 4d346bfa..4e1974d7 100644
--- a/handlers/swuforward_handler.c
+++ b/handlers/swuforward_handler.c
@@ -297,6 +297,9 @@  static int install_remote_swu(struct img_type *img,
 	pthread_attr_t attr;
 	int thread_ret = -1;

+	/* Reset list of connections */
+	LIST_INIT(&priv.conns);
+
 	/*
 	 * A single SWU can contains encrypted artifacts,
 	 * but the SWU itself cannot be encrypted.
@@ -329,9 +332,6 @@  static int install_remote_swu(struct img_type *img,
 		goto handler_exit;
 	}

-	/* Reset list of connections */
-	LIST_INIT(&priv.conns);
-
 	/* initialize CURL */
 	ret = curl_global_init(CURL_GLOBAL_DEFAULT);
 	if (ret != CURLE_OK) {