Bug 93587 - Avoiding redundant check
Summary: Avoiding redundant check
Status: RESOLVED FIXED
Alias: None
Product: p11-glue
Classification: Unclassified
Component: p11-kit (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Stef Walter
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-05 09:52 UTC by Pankaj
Modified: 2016-01-05 09:57 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
p11-kit modules patch (697 bytes, patch)
2016-01-05 09:52 UTC, Pankaj
Details | Splinter Review
modified patches (803 bytes, patch)
2016-01-05 09:55 UTC, Pankaj
Details | Splinter Review

Description Pankaj 2016-01-05 09:52:02 UTC
Created attachment 120806 [details] [review]
p11-kit modules patch

Hi,
There is an issue reported for redundant check at line :
p11-kit/modules.c:2329 and 2335
the respective patch has been attached please review it.
===========================================================
diff --git a/p11-kit/modules.c b/p11-kit/modules.c
index acb3707..63baeb1 100644
--- a/p11-kit/modules.c
+++ b/p11-kit/modules.c
@@ -2326,17 +2326,15 @@ p11_module_load_inlock_reentrant (CK_FUNCTION_LIST *module,
                }

                /* If this was newly allocated, add it to the list */
-               if (rv == CKR_OK && allocated) {
+               if (allocated) {
                        if (!p11_dict_set (gl.modules, allocated, allocated) ||
                            !p11_dict_set (gl.unmanaged_by_funcs, module, allocated))
                                return_val_if_reached (CKR_HOST_MEMORY);
                        allocated = NULL;
                }

-               if (rv == CKR_OK) {
                        /* WARNING: Reentrancy can occur here */
                        rv = prepare_module_inlock_reentrant (mod, flags, result);
-               }

                free (allocated);
        }






-----------------------------------------------------------
Thanks!
Pankaj Sharma
Comment 1 Pankaj 2016-01-05 09:55:57 UTC
Created attachment 120807 [details] [review]
modified patches
Comment 2 Stef Walter 2016-01-05 09:57:32 UTC
Thanks. Merged into git master.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.