diff options
| author | Sudheer Papothi <spapothi@codeaurora.org> | 2016-02-03 01:35:14 +0530 |
|---|---|---|
| committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-23 21:19:28 -0700 |
| commit | db36660f6c2cf201e81490dd84ed0217a446c9aa (patch) | |
| tree | 06b20ecbf0d088642f6e8ab18cd1e06c5e7d966c | |
| parent | 6880b76660d152912c9158f22e82938bdbd50277 (diff) | |
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>
| -rwxr-xr-x | drivers/soundwire/soundwire.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/soundwire/soundwire.c b/drivers/soundwire/soundwire.c index edcd6210dd84..23642fe38ef3 100755 --- a/drivers/soundwire/soundwire.c +++ b/drivers/soundwire/soundwire.c @@ -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; |
