wext: handle NULL extra data in iwe_stream_add_point better
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / include / net / iw_handler.h
index 3afdb21cc31d263e8e53a7de7e9ca46cde4b4b6f..5af07a1ab0c2b560da196669d76d25e92c650e42 100644 (file)
@@ -91,7 +91,7 @@
  * --------------------
  * The implementation goals were as follow :
  *     o Obvious : you should not need a PhD to understand what's happening,
- *             the benefit is easier maintainance.
+ *             the benefit is easier maintenance.
  *     o Flexible : it should accommodate a wide variety of driver
  *             implementations and be as flexible as the old API.
  *     o Lean : it should be efficient memory wise to minimise the impact
  *
  * Functions prototype uses union iwreq_data
  * -----------------------------------------
- * Some would have prefered functions defined this way :
+ * Some would have preferred functions defined this way :
  *     static int mydriver_ioctl_setrate(struct net_device *dev, 
  *                                       long rate, int auto)
  * 1) The kernel code doesn't "validate" the content of iwreq_data, and
@@ -551,7 +551,8 @@ iwe_stream_add_point(struct iw_request_info *info, char *stream, char *ends,
                memcpy(stream + lcp_len,
                       ((char *) &iwe->u) + IW_EV_POINT_OFF,
                       IW_EV_POINT_PK_LEN - IW_EV_LCP_PK_LEN);
-               memcpy(stream + point_len, extra, iwe->u.data.length);
+               if (iwe->u.data.length && extra)
+                       memcpy(stream + point_len, extra, iwe->u.data.length);
                stream += event_len;
        }
        return stream;