]> Pileus Git - ~andy/linux/blobdiff - drivers/staging/tm6000/tm6000-video.c
V4L/DVB: tm6000: Fix a panic if buffer become NULL
[~andy/linux] / drivers / staging / tm6000 / tm6000-video.c
index 92edb4185868f3364714ebef80dc8dc8c9925596..edc59424d2604eba4a40d2c185940660cc2df6f5 100644 (file)
@@ -397,6 +397,8 @@ HEADER:
                                        jiffies);
                        return rc;
                }
+               if (!*buf)
+                       return 0;
        }
 
        return 0;
@@ -530,7 +532,7 @@ static inline int tm6000_isoc_copy(struct urb *urb)
                                }
                        }
                        copied += len;
-                       if (copied>=size)
+                       if (copied >= size || !buf)
                                break;
 //             }
        }