diff options
author | Jubeom Kim <jubeomk@nvidia.com> | 2011-06-22 22:56:21 +0900 |
---|---|---|
committer | Varun Colbert <vcolbert@nvidia.com> | 2011-07-01 10:40:04 -0700 |
commit | b5f28ca169a8f4c8667ba845fddc7742af03caa7 (patch) | |
tree | 4219b6a1ca52ca500980c19c251f55830454b44c /drivers/media | |
parent | 3195cad71daf5b0e4a1ab9d49f8ec91810db3d4a (diff) |
tegra_mediaserver: fix wrong kzalloc param, uninitialized values
- Changed the kzalloc param from node to block.
- 'CHECK_CONDITION((physical_address < 0), ...' is not valid,
because the physical_address value is unsigned value.
- Fixed uninitialized values
Reviewed-on: http://git-master/r/37862
(cherry picked from commit 06d905e9ed14d28224d5f59acf75b4de503f8796)
Change-Id: Ifad28f75b159356acbc045e5e985a618aa8df81b
Reviewed-on: http://git-master/r/38448
Tested-by: Jubeom Kim <jubeomk@nvidia.com>
Reviewed-by: Stephen Holmes <sholmes@nvidia.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/tegra/mediaserver/tegra_mediaserver.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/media/video/tegra/mediaserver/tegra_mediaserver.c b/drivers/media/video/tegra/mediaserver/tegra_mediaserver.c index e25e1926d99e..a26b9e990ca1 100644 --- a/drivers/media/video/tegra/mediaserver/tegra_mediaserver.c +++ b/drivers/media/video/tegra/mediaserver/tegra_mediaserver.c @@ -244,7 +244,7 @@ static int mediasrv_alloc(struct tegra_mediasrv_node *node, { struct tegra_mediasrv_block *block; - block = kzalloc(sizeof(struct tegra_mediasrv_node), + block = kzalloc(sizeof(struct tegra_mediasrv_block), GFP_KERNEL); CHECK_NULL(block, block_alloc_fail); @@ -269,7 +269,8 @@ block_done: if (!mediasrv->nr_iram_shared) { size_t align, size; struct nvmap_handle_ref *r = NULL; - unsigned long id, physical_address; + unsigned long id; + int physical_address; size = PAGE_ALIGN(in->in.u.iram.size); r = nvmap_create_handle(mediasrv->nvmap, size); @@ -339,7 +340,7 @@ static void mediasrv_free(struct tegra_mediasrv_node *node, switch (in->in.tegra_mediaserver_resource_type) { case TEGRA_MEDIASERVER_RESOURCE_BLOCK: { - struct tegra_mediasrv_block *block; + struct tegra_mediasrv_block *block = NULL; struct tegra_mediasrv_block *temp; struct list_head *entry; @@ -392,7 +393,7 @@ static int mediasrv_update_block_info( union tegra_mediaserver_update_block_info *in ) { - struct tegra_mediasrv_block *entry; + struct tegra_mediasrv_block *entry = NULL; struct tegra_mediasrv_block *block; int e; |