From: Stefan Hajnoczi <[email protected]>

The line6 driver checks struct field addresses for NULL where it does
not make sense to do so.  The struct has already been checked for NULL
and there is no value in checking the first field's address too.

Suggested-by: Dan Carpenter <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
---
 pod.c      |    6 +-----
 podhd.c    |    6 +-----
 toneport.c |    6 +-----
 variax.c   |    6 +-----
 4 files changed, 4 insertions(+), 20 deletions(-)

diff --git a/pod.c b/pod.c
index d9b3021..4dadc57 100644
--- a/pod.c
+++ b/pod.c
@@ -1149,14 +1149,10 @@ static struct snd_kcontrol_new pod_control_monitor = {
 static void pod_destruct(struct usb_interface *interface)
 {
        struct usb_line6_pod *pod = usb_get_intfdata(interface);
-       struct usb_line6 *line6;
 
        if (pod == NULL)
                return;
-       line6 = &pod->line6;
-       if (line6 == NULL)
-               return;
-       line6_cleanup_audio(line6);
+       line6_cleanup_audio(&pod->line6);
 
        del_timer(&pod->startup_timer);
        cancel_work_sync(&pod->startup_work);
diff --git a/podhd.c b/podhd.c
index 6c0f7f2..7ef4543 100644
--- a/podhd.c
+++ b/podhd.c
@@ -80,14 +80,10 @@ static struct line6_pcm_properties podhd_pcm_properties = {
 static void podhd_destruct(struct usb_interface *interface)
 {
        struct usb_line6_podhd *podhd = usb_get_intfdata(interface);
-       struct usb_line6 *line6;
 
        if (podhd == NULL)
                return;
-       line6 = &podhd->line6;
-       if (line6 == NULL)
-               return;
-       line6_cleanup_audio(line6);
+       line6_cleanup_audio(&podhd->line6);
 }
 
 /*
diff --git a/toneport.c b/toneport.c
index 879e699..f310578 100644
--- a/toneport.c
+++ b/toneport.c
@@ -295,14 +295,10 @@ static struct snd_kcontrol_new toneport_control_source = {
 static void toneport_destruct(struct usb_interface *interface)
 {
        struct usb_line6_toneport *toneport = usb_get_intfdata(interface);
-       struct usb_line6 *line6;
 
        if (toneport == NULL)
                return;
-       line6 = &toneport->line6;
-       if (line6 == NULL)
-               return;
-       line6_cleanup_audio(line6);
+       line6_cleanup_audio(&toneport->line6);
 }
 
 /*
diff --git a/variax.c b/variax.c
index 81241cd..d366222 100644
--- a/variax.c
+++ b/variax.c
@@ -572,14 +572,10 @@ static DEVICE_ATTR(raw2, S_IWUSR, line6_nop_read, 
variax_set_raw2);
 static void variax_destruct(struct usb_interface *interface)
 {
        struct usb_line6_variax *variax = usb_get_intfdata(interface);
-       struct usb_line6 *line6;
 
        if (variax == NULL)
                return;
-       line6 = &variax->line6;
-       if (line6 == NULL)
-               return;
-       line6_cleanup_audio(line6);
+       line6_cleanup_audio(&variax->line6);
 
        del_timer(&variax->startup_timer1);
        del_timer(&variax->startup_timer2);
-- 
1.7.7.3


------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Line6linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/line6linux-devel

Reply via email to