]> Zhao Yanbai Git Server - minix.git/commitdiff
libmagic: free actual dsentry rather than a copy 45/3145/1
authorDavid van Moolenbroek <david@minix3.org>
Fri, 17 Jul 2015 19:36:58 +0000 (21:36 +0200)
committerDavid van Moolenbroek <david@minix3.org>
Thu, 17 Sep 2015 14:00:07 +0000 (14:00 +0000)
This resolves an infinite loop during boot, in libblockdriver freeing
DMA memory at the end of a partition(3) call.

Change-Id: I0757aa48f769ea79eab7160f23ee4c97cf58e055

minix/llvm/static/magic/magic_mem.c

index 77b2eb2034a72a1abb90877298db5f6bb1d758f6..d22a2f23f6e44f3bfc042707f77e45a828ce510a 100644 (file)
@@ -853,7 +853,6 @@ PUBLIC void magic_destroy_dsentry(struct _magic_dsentry *dsentry,
  *===========================================================================*/
 PUBLIC int magic_destroy_obdsentry_by_addr(void *data_ptr)
 {
-    struct _magic_dsentry _magic_dsentry_buff;
     struct _magic_sentry *sentry;
     struct _magic_dsentry *dsentry;
     struct _magic_obdsentry *obdsentry;
@@ -862,7 +861,7 @@ PUBLIC int magic_destroy_obdsentry_by_addr(void *data_ptr)
     MAGIC_MEM_WRAPPER_LBEGIN();
 
     /* Lookup the obdsentry. */
-    sentry = magic_sentry_lookup_by_addr(data_ptr, &_magic_dsentry_buff);
+    sentry = magic_sentry_lookup_by_addr(data_ptr, NULL);
     if(!sentry || ((sentry->flags & obflags) != obflags)) {
         MAGIC_MEM_WRAPPER_LEND();
         return MAGIC_EINVAL;