aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/light.c
diff options
context:
space:
mode:
authorRui Miguel Silva <rmfrfs@gmail.com>2016-09-30 19:24:32 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-10-02 15:49:26 +0200
commit3855eeec1a47cace93acd5ff89fb3c9bd593d307 (patch)
tree30ffe5331c01654141bac4fb8eb3131939a17a08 /drivers/staging/greybus/light.c
parentstaging: greybus: sdio: fix cmd_flags check for none response (diff)
downloadlinux-dev-3855eeec1a47cace93acd5ff89fb3c9bd593d307.tar.xz
linux-dev-3855eeec1a47cace93acd5ff89fb3c9bd593d307.zip
staging: greybus: light: fix attributes allocation
Fix allocation of attributes with the correct size, this also fix smatch warning: drivers/staging/greybus/light.c:293 channel_attr_groups_set() warn: double check that we're allocating correct size: 8 vs 16 Signed-off-by: Rui Miguel Silva <rmfrfs@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/greybus/light.c')
-rw-r--r--drivers/staging/greybus/light.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/staging/greybus/light.c b/drivers/staging/greybus/light.c
index b2847feb7e86..f3cd48521af0 100644
--- a/drivers/staging/greybus/light.c
+++ b/drivers/staging/greybus/light.c
@@ -290,8 +290,7 @@ static int channel_attr_groups_set(struct gb_channel *channel,
return 0;
/* Set attributes based in the channel flags */
- channel->attrs = kcalloc(size + 1, sizeof(**channel->attrs),
- GFP_KERNEL);
+ channel->attrs = kcalloc(size + 1, sizeof(*channel->attrs), GFP_KERNEL);
if (!channel->attrs)
return -ENOMEM;
channel->attr_group = kcalloc(1, sizeof(*channel->attr_group),