From: Omar Ramirez Luna <omar.ramirez@ti.com>
To: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Omar Ramirez Luna <omar.ramirez@ti.com>,
Felipe Contreras <felipe.contreras@gmail.com>,
devel@driverdev.osuosl.org, linux-omap@vger.kernel.org
Subject: [PATCH 2/2] staging: tidspbridge: fix incorrect free to drv_datap
Date: Mon, 30 Jan 2012 19:20:18 -0600 [thread overview]
Message-ID: <1327972818-30993-3-git-send-email-omar.ramirez@ti.com> (raw)
In-Reply-To: <1327972818-30993-1-git-send-email-omar.ramirez@ti.com>
This structure is still used after it has been freed, since it
is being allocated in probe, calls to free it have been moved to
module's remove routine.
This should fix the follwoing messages when attempting to remove the
module:
drv_get_first_dev_extension: Failed to retrieve the object handle
drv_get_first_dev_extension: Failed to retrieve the object handle
drv_destroy: Failed to store DRV object
mgr_destroy: Failed to store MGR object
Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
---
drivers/staging/tidspbridge/core/tiomap3430.c | 2 --
drivers/staging/tidspbridge/rmgr/drv_interface.c | 3 +++
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/tidspbridge/core/tiomap3430.c b/drivers/staging/tidspbridge/core/tiomap3430.c
index e1c4492..dde559d 100644
--- a/drivers/staging/tidspbridge/core/tiomap3430.c
+++ b/drivers/staging/tidspbridge/core/tiomap3430.c
@@ -1046,8 +1046,6 @@ static int bridge_dev_destroy(struct bridge_dev_context *dev_ctxt)
/* Free the driver's device context: */
kfree(drv_datap->base_img);
- kfree(drv_datap);
- dev_set_drvdata(bridge, NULL);
kfree((void *)dev_ctxt);
return status;
}
diff --git a/drivers/staging/tidspbridge/rmgr/drv_interface.c b/drivers/staging/tidspbridge/rmgr/drv_interface.c
index 8bac511..385740b 100644
--- a/drivers/staging/tidspbridge/rmgr/drv_interface.c
+++ b/drivers/staging/tidspbridge/rmgr/drv_interface.c
@@ -410,6 +410,9 @@ static int __devexit omap34_xx_bridge_remove(struct platform_device *pdev)
DBC_ASSERT(ret == true);
}
+ kfree(drv_datap);
+ dev_set_drvdata(bridge, NULL);
+
func_cont:
mem_ext_phys_pool_release();
--
1.7.4.1
next prev parent reply other threads:[~2012-01-31 1:20 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-31 1:20 [PATCH 0/2] staging: tidspbridge: memory leak fixes Omar Ramirez Luna
2012-01-31 1:20 ` [PATCH 1/2] staging: tidspbridge: fix bridge_open memory leaks Omar Ramirez Luna
2012-01-31 8:17 ` Dan Carpenter
2012-01-31 18:09 ` Omar Ramirez Luna
2012-01-31 18:40 ` Dan Carpenter
2012-01-31 1:20 ` Omar Ramirez Luna [this message]
2012-01-31 8:21 ` [PATCH 2/2] staging: tidspbridge: fix incorrect free to drv_datap Dan Carpenter
2012-01-31 18:19 ` Ramirez Luna, Omar
2012-01-31 18:43 ` Dan Carpenter
2012-01-31 19:39 ` Felipe Contreras
2012-02-01 6:58 ` Dan Carpenter
2012-02-01 7:27 ` Felipe Contreras
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1327972818-30993-3-git-send-email-omar.ramirez@ti.com \
--to=omar.ramirez@ti.com \
--cc=devel@driverdev.osuosl.org \
--cc=felipe.contreras@gmail.com \
--cc=gregkh@suse.de \
--cc=linux-omap@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.