[PATCHv2] Some coverity fixes
Michael Adam
obnox at samba.org
Mon Aug 3 11:20:31 UTC 2015
Hi Anoop,
Thanks for the patches. These look good!
Reviewed-by: /me
Michael
On 2015-08-03 at 14:19 +0530, Anoop C S wrote:
> On Mon, 2015-08-03 at 10:16 +0200, Stefan Metzmacher wrote:
> > Hi Anoop,
> >
> > > Reviews are welcome.
> >
> > Can you please tabs instead of whitespaces?
> >
>
> I have changed white spaces to tabs. Please see the updated version
> attached along with this message.
>
> > The change to uwrap_thread_child() seems to be wrong:
> > uwrap_thread_prepare() takes the locks,
> > while uwrap_thread_parent() and uwrap_thread_child()
> > unlock.
> >
>
> Thanks. So removing the same from attached patches.
>
> --Anoop C S.
>
> > The other patches look good to me Reviewed-by: me
> >
> > metze
> >
> From 14a71c843e2f6dd8bc2313bf754b2ddef425f6c6 Mon Sep 17 00:00:00 2001
> From: Anoop C S <anoopcs at redhat.com>
> Date: Mon, 3 Aug 2015 13:57:19 +0530
> Subject: [PATCH 1/3] lib/talloc: Fix CID 1291640 Missing unlock
>
> Signed-off-by: Anoop C S <anoopcs at redhat.com>
> ---
> lib/talloc/testsuite.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/lib/talloc/testsuite.c b/lib/talloc/testsuite.c
> index 6d0fe94..011ad21 100644
> --- a/lib/talloc/testsuite.c
> +++ b/lib/talloc/testsuite.c
> @@ -1747,6 +1747,7 @@ static void *thread_fn(void *arg)
> ret = pthread_cond_wait(&condvar, &mtx);
> if (ret != 0) {
> talloc_free(top_ctx);
> + pthread_mutex_unlock(&mtx);
> return NULL;
> }
> }
> --
> 2.4.3
>
> From 991b3d4be57317252a3d96c150ae988211cd8091 Mon Sep 17 00:00:00 2001
> From: Anoop C S <anoopcs at redhat.com>
> Date: Mon, 3 Aug 2015 13:59:33 +0530
> Subject: [PATCH 2/3] lib/talloc: Fix CID 1291639 Missing unlock
>
> Signed-off-by: Anoop C S <anoopcs at redhat.com>
> ---
> lib/talloc/testsuite.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/lib/talloc/testsuite.c b/lib/talloc/testsuite.c
> index 011ad21..c67cfb9 100644
> --- a/lib/talloc/testsuite.c
> +++ b/lib/talloc/testsuite.c
> @@ -1828,6 +1828,7 @@ static bool test_pthread_talloc_passing(void)
> printf("pthread_cond_wait %d failed (%d)\n", i,
> ret);
> talloc_free(mem_ctx);
> + pthread_mutex_unlock(&mtx);
> return false;
> }
> }
> --
> 2.4.3
>
> From 36a3df7721b24b353082caf044a83b31ff6b1d2a Mon Sep 17 00:00:00 2001
> From: Anoop C S <anoopcs at redhat.com>
> Date: Mon, 3 Aug 2015 14:01:58 +0530
> Subject: [PATCH 3/3] source3/rpc_client: Fix CID 1273041 Condition is
> redundant
>
> Signed-off-by: Anoop C S <anoopcs at redhat.com>
> ---
> source3/rpc_client/rpc_transport_np.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/source3/rpc_client/rpc_transport_np.c b/source3/rpc_client/rpc_transport_np.c
> index b928b7c..9dc5c56 100644
> --- a/source3/rpc_client/rpc_transport_np.c
> +++ b/source3/rpc_client/rpc_transport_np.c
> @@ -141,7 +141,8 @@ static void rpc_transport_np_init_pipe_open(struct tevent_req *subreq)
> timeval_current_ofs_msec(100 * state->retries),
> rpc_transport_np_init_pipe_open_retry, req);
> if (tevent_req_nomem(te, req)) {
> - return;
> + DEBUG(2, ("Failed to create asynchronous "
> + "tevent_timer"));
> }
> return;
> } else if (!NT_STATUS_IS_OK(status)) {
> --
> 2.4.3
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20150803/92b709dd/attachment.sig>
More information about the samba-technical
mailing list