diff options
author | Madhumitha Prabakaran <madhumithabiw@gmail.com> | 2019-03-25 11:53:37 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-03-26 05:44:53 +0900 |
commit | a3703713e18a74103c2a0c2206ebc759fe068ca6 (patch) | |
tree | ce57c8a1f1ff3c1c17408d11d9668271d5832098 /drivers/staging/media | |
parent | staging: media: zoran: Use unsigned int instead of unsigned (diff) | |
download | linux-dev-a3703713e18a74103c2a0c2206ebc759fe068ca6.tar.xz linux-dev-a3703713e18a74103c2a0c2206ebc759fe068ca6.zip |
Staging: media: davinci_vpfe: Fix preferred form of passing a size
Fix preferred form of passing a size of a struct to improve readability
and eradicate an opportunity for a bug when the pointer variable type is
changed but the corresponding sizeof that is passed to a memory
allocator is not.
Signed-off-by: Madhumitha Prabakaran <madhumithabiw@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/media')
-rw-r--r-- | drivers/staging/media/davinci_vpfe/dm365_ipipe.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/staging/media/davinci_vpfe/dm365_ipipe.c b/drivers/staging/media/davinci_vpfe/dm365_ipipe.c index 3d910b85905c..30e2edc0cec5 100644 --- a/drivers/staging/media/davinci_vpfe/dm365_ipipe.c +++ b/drivers/staging/media/davinci_vpfe/dm365_ipipe.c @@ -1264,8 +1264,7 @@ static int ipipe_s_config(struct v4l2_subdev *sd, struct vpfe_ipipe_config *cfg) module_if = &ipipe_modules[i]; from = *(void **)((void *)cfg + module_if->config_offset); - params = kmalloc(sizeof(struct ipipe_module_params), - GFP_KERNEL); + params = kmalloc(sizeof(*params), GFP_KERNEL); to = (void *)params + module_if->param_offset; size = module_if->param_size; @@ -1306,8 +1305,7 @@ static int ipipe_g_config(struct v4l2_subdev *sd, struct vpfe_ipipe_config *cfg) module_if = &ipipe_modules[i]; to = *(void **)((void *)cfg + module_if->config_offset); - params = kmalloc(sizeof(struct ipipe_module_params), - GFP_KERNEL); + params = kmalloc(sizeof(*params), GFP_KERNEL); from = (void *)params + module_if->param_offset; size = module_if->param_size; |