brcm2708: rename target to bcm27xx
[openwrt/staging/wigyori.git] / target / linux / bcm27xx / patches-4.19 / 950-0118-sound-bcm-Fix-memset-dereference-warning.patch
1 From b6258886ad6bd69b3d51b9c79ea6ada0e01b2db9 Mon Sep 17 00:00:00 2001
2 From: Nathan Chancellor <natechancellor@gmail.com>
3 Date: Sun, 4 Mar 2018 17:20:25 -0700
4 Subject: [PATCH] sound: bcm: Fix memset dereference warning
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 This warning appears with GCC 6.4.0 from toolchains.bootlin.com:
10
11 ../sound/soc/bcm/allo-piano-dac-plus.c: In function ‘snd_allo_piano_dac_init’:
12 ../sound/soc/bcm/allo-piano-dac-plus.c:711:30: warning: argument to ‘sizeof’ in ‘memset’ call is the same expression as the destination; did you mean to dereference it? [-Wsizeof-pointer-memaccess]
13 memset(glb_ptr, 0x00, sizeof(glb_ptr));
14 ^
15
16 Suggested-by: Phil Elwell <phil@raspberrypi.org>
17 Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
18 ---
19 sound/soc/bcm/allo-piano-dac-plus.c | 3 +--
20 1 file changed, 1 insertion(+), 2 deletions(-)
21
22 --- a/sound/soc/bcm/allo-piano-dac-plus.c
23 +++ b/sound/soc/bcm/allo-piano-dac-plus.c
24 @@ -706,11 +706,10 @@ static int snd_allo_piano_dac_init(struc
25 struct snd_soc_card *card = rtd->card;
26 struct glb_pool *glb_ptr;
27
28 - glb_ptr = kmalloc(sizeof(struct glb_pool), GFP_KERNEL);
29 + glb_ptr = kzalloc(sizeof(struct glb_pool), GFP_KERNEL);
30 if (!glb_ptr)
31 return -ENOMEM;
32
33 - memset(glb_ptr, 0x00, sizeof(glb_ptr));
34 card->drvdata = glb_ptr;
35 glb_ptr->dual_mode = 2;
36 glb_ptr->set_mode = 0;