soundwire: Fix NULL pointer check while setting group ID
Fix NULL pointer check while setting group ID to avoid dereferening of the pointer. CRs-Fixed: 971240 Change-Id: Ic5aae901244e7b2b96a894d265a6cc5c119f0367 Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
This commit is contained in:
parent
6880b76660
commit
db36660f6c
1 changed files with 4 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2015, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 and
|
||||
|
@ -618,11 +618,13 @@ EXPORT_SYMBOL(swr_reset_device);
|
|||
*/
|
||||
int swr_set_device_group(struct swr_device *swr_dev, u8 id)
|
||||
{
|
||||
struct swr_master *master = swr_dev->master;
|
||||
struct swr_master *master;
|
||||
|
||||
if (!swr_dev)
|
||||
return -EINVAL;
|
||||
|
||||
swr_dev->group_id = id;
|
||||
master = swr_dev->master;
|
||||
if (!id && master)
|
||||
master->gr_sid = 0;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue