libmagic: free actual dsentry rather than a copy

This resolves an infinite loop during boot, in libblockdriver freeing
DMA memory at the end of a partition(3) call.

Change-Id: I0757aa48f769ea79eab7160f23ee4c97cf58e055
This commit is contained in:
David van Moolenbroek 2015-07-17 21:36:58 +02:00
parent 949a3e52e5
commit 40aba308a0

View file

@ -853,7 +853,6 @@ PUBLIC void magic_destroy_dsentry(struct _magic_dsentry *dsentry,
*===========================================================================*/ *===========================================================================*/
PUBLIC int magic_destroy_obdsentry_by_addr(void *data_ptr) PUBLIC int magic_destroy_obdsentry_by_addr(void *data_ptr)
{ {
struct _magic_dsentry _magic_dsentry_buff;
struct _magic_sentry *sentry; struct _magic_sentry *sentry;
struct _magic_dsentry *dsentry; struct _magic_dsentry *dsentry;
struct _magic_obdsentry *obdsentry; struct _magic_obdsentry *obdsentry;
@ -862,7 +861,7 @@ PUBLIC int magic_destroy_obdsentry_by_addr(void *data_ptr)
MAGIC_MEM_WRAPPER_LBEGIN(); MAGIC_MEM_WRAPPER_LBEGIN();
/* Lookup the obdsentry. */ /* 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)) { if(!sentry || ((sentry->flags & obflags) != obflags)) {
MAGIC_MEM_WRAPPER_LEND(); MAGIC_MEM_WRAPPER_LEND();
return MAGIC_EINVAL; return MAGIC_EINVAL;