1. 07 11月, 2017 1 次提交
  2. 04 11月, 2017 1 次提交
  3. 11 10月, 2017 1 次提交
    • A
      usb: gadget: configfs: Fix memory leak of interface directory data · ff74745e
      Andrew Gabbasov 提交于
      Kmemleak checking configuration reports a memory leak in
      usb_os_desc_prepare_interf_dir function when rndis function
      instance is freed and then allocated again. For example, this
      happens with FunctionFS driver with RNDIS function enabled
      when "ffs-test" test application is run several times in a row.
      
      The data for intermediate "os_desc" group for interface directories
      is allocated as a single VLA chunk and (after a change of default
      groups handling) is not ever freed and actually not stored anywhere
      besides inside a list of default groups of a parent group.
      
      The fix is to make usb_os_desc_prepare_interf_dir function return
      a pointer to allocated data (as a pointer to the first VLA item)
      instead of (an unused) integer and to make the caller component
      (currently the only one is RNDIS function) responsible for storing
      the pointer and freeing the memory when appropriate.
      
      Fixes: 1ae1602d ("configfs: switch ->default groups to a linked list")
      Cc: stable@vger.kernel.org
      Signed-off-by: NAndrew Gabbasov <andrew_gabbasov@mentor.com>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      ff74745e
  4. 15 8月, 2017 1 次提交
  5. 22 8月, 2016 1 次提交
  6. 06 3月, 2016 1 次提交
  7. 04 3月, 2016 1 次提交
  8. 14 10月, 2015 1 次提交
  9. 27 9月, 2015 1 次提交
  10. 08 5月, 2015 2 次提交
    • A
      usb: gadget: rndis: remove the limit of available rndis connections · d6d22922
      Andrzej Pietrasiewicz 提交于
      RNDIS function has a limitation on the number of allowed instances.
      So far it has been RNDIS_MAX_CONFIGS, which happens to be one.
      In order to eliminate this kind of arbitrary limitation we should not
      preallocate a predefined (RNDIS_MAX_CONFIGS) array of struct rndis_params
      instances but instead allow allocating them on demand.
      
      This patch allocates struct rndis_params on demand in rndis_register().
      Coversly, the structure is free()'d in rndis_deregister().
      If CONFIG_USB_GADGET_DEBUG_FILES is set, the proc files are created which
      is the same behaviour as before, but the moment of creation is delayed
      until struct rndis_params is actually allocated.
      
      rnids_init() and rndis_exit() have nothing to do, so they are eliminated.
      Signed-off-by: NAndrzej Pietrasiewicz <andrzej.p@samsung.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      d6d22922
    • A
      usb: gadget: rndis: use rndis_params instead of configNr · 83210e59
      Andrzej Pietrasiewicz 提交于
      RNDIS function has a limitation on the number of allowed instances.
      So far it has been RNDIS_MAX_CONFIGS, which happens to be one.
      In order to eliminate this kind of arbitrary limitation we should not
      preallocate a predefined (RNDIS_MAX_CONFIGS) array of struct rndis_params
      instances but instead allow allocating them on demand.
      
      This patch prepares the elimination of the said limit by converting all the
      functions which accept rndis config number to accept a pointer to the
      actual struct rndis_params. Consequently, rndis_register() returns
      a pointer to a corresponding struct rndis_params instance. The pointer
      is then always used by f_rndis.c instead of config number when it talks
      to rndis.c API.
      
      A nice side-effect of the changes is that many lines of code in rndis.c
      become shorter and fit in 80 columns.
      
      If a function prototype changes in rndis.h a style cleanup is made
      at the same time, otherwise checkpatch complains that the patch
      has style problems.
      Signed-off-by: NAndrzej Pietrasiewicz <andrzej.p@samsung.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      83210e59
  11. 21 11月, 2014 1 次提交
  12. 24 10月, 2014 2 次提交
  13. 17 7月, 2014 2 次提交
  14. 19 6月, 2014 2 次提交
  15. 14 5月, 2014 2 次提交
  16. 22 4月, 2014 1 次提交
  17. 21 4月, 2014 1 次提交
  18. 13 12月, 2013 2 次提交
  19. 26 7月, 2013 2 次提交
  20. 10 6月, 2013 4 次提交
  21. 03 4月, 2013 1 次提交
  22. 20 3月, 2013 1 次提交
  23. 31 10月, 2012 4 次提交
  24. 13 5月, 2012 1 次提交
    • L
      usb/net: rndis: merge media type definitions · 17c51b6c
      Linus Walleij 提交于
      Let's have a unified table of RNDIS media. We used to have a similar
      table with NDIS_* prefix from the gadget driver, but since we're only
      using RNDIS in the kernel (IIRC NDIS, non-remote, is for the windows-
      internal network drivers so what do we care) let's prefix everything
      with RNDIS. Some of the definitions were conflicting, in one of the
      defines 0x0B is bearer "CO WAN" and in two others "BPC". Well I took
      the majority vote. Two definition of medium 0x09 calls it "wireless
      WAN" but one vote for "wireless LAN" but in this case I am sticking
      with the minority, "Wide Area Network" does not make much sense in
      this case as far as I can tell.
      
      NOTE: latin singular and plural is so screwed up in these defines
      that it makes my eyes bleed. But I will not attempt to submit a
      patch converting all use of _MEDIA_ to _MEDIUM_ while I can probably
      tell from the semantics of the code that RNDIS_MEDIA_STATE_CONNECTED
      is most probably (erroneously) referring to a singular, unless it
      can return an array of connected media. I suspect these erroneous
      plurals are used in documentation and such so I don't want to
      mess around with things for no functional change.
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      17c51b6c
  25. 11 5月, 2012 2 次提交
  26. 11 4月, 2012 1 次提交