Explorar o código

[PATCH] Driver Core: Big kfree NULL check cleanup - Documentation

This is the Documentation/ part of the big kfree cleanup patch.

Remove pointless checks for NULL prior to calling kfree() in example code in Documentation/.

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Jesper Juhl %!s(int64=19) %!d(string=hai) anos
pai
achega
a3a3395e48
Modificáronse 1 ficheiros con 1 adicións e 2 borrados
  1. 1 2
      Documentation/DocBook/writing_usb_driver.tmpl

+ 1 - 2
Documentation/DocBook/writing_usb_driver.tmpl

@@ -345,8 +345,7 @@ if (!retval) {
   <programlisting>
 static inline void skel_delete (struct usb_skel *dev)
 {
-    if (dev->bulk_in_buffer != NULL)
-        kfree (dev->bulk_in_buffer);
+    kfree (dev->bulk_in_buffer);
     if (dev->bulk_out_buffer != NULL)
         usb_buffer_free (dev->udev, dev->bulk_out_size,
             dev->bulk_out_buffer,