05 Dec, 2019

1 commit

  • commit b7aa39a2ed0112d07fc277ebd24a08a7b2368ab9 upstream.

    The variable skb is released via kfree_skb() when the return value of
    _rtl92e_tx is not zero. However, after that, skb is accessed again to
    read its length, which may result in a use after free bug. This patch
    fixes the bug by moving the release operation to where skb is never
    used later.

    Signed-off-by: Pan Bian
    Reviewed-by: Dan Carpenter
    Cc: stable
    Link: https://lore.kernel.org/r/1572965351-6745-1-git-send-email-bianpan2016@163.com
    Signed-off-by: Greg Kroah-Hartman

    Pan Bian
     

05 Sep, 2019

1 commit


22 Aug, 2019

2 commits

  • Fixes gcc '-Wunused-but-set-variable' warning:

    In function ieee80211_ccmp_encrypt:
    drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c:162:6:
    warning: variable data_len set but not used [-Wunused-but-set-variable]

    It is not used since commit 5ee5265674ce ("staging:
    rtl8192e: rtllib_crypt_ccmp.c: Use crypto API ccm(aes)")

    Reported-by: Hulk Robot
    Signed-off-by: YueHaibing
    Link: https://lore.kernel.org/r/20190821122802.44028-1-yuehaibing@huawei.com
    Signed-off-by: Greg Kroah-Hartman

    YueHaibing
     
  • Fixes gcc '-Wunused-but-set-variable' warning:

    In function '_rtl92e_dm_tx_power_tracking_callback_tssi':
    drivers/staging/rtl8192e/rtl8192e/rtl_dm.c:621:7:
    warning: variable 'bHighpowerstate' set but not used [-Wunused-but-set-variable]
    In function '_rtl92e_dm_rx_path_sel_byrssi':
    drivers/staging/rtl8192e/rtl8192e/rtl_dm.c:1904:32:
    warning: variable 'cck_rx_ver2_min_index' set but not used [-Wunused-but-set-variable]

    They are never used, so can be removed.

    Reported-by: Hulk Robot
    Signed-off-by: YueHaibing
    Link: https://lore.kernel.org/r/20190821122556.37636-1-yuehaibing@huawei.com
    Signed-off-by: Greg Kroah-Hartman

    YueHaibing
     

18 Aug, 2019

1 commit


05 Aug, 2019

1 commit

  • As kmemdup API does kmalloc + memcpy . We can make use of it instead of
    calling kmalloc and memcpy independetly.

    Signed-off-by: Hariprasad Kelam
    Link: https://lore.kernel.org/r/20190804024832.GA14352@hari-Inspiron-1545
    Signed-off-by: Greg Kroah-Hartman

    Hariprasad Kelam
     

30 Jul, 2019

1 commit


25 Jul, 2019

2 commits

  • Everywhere else in the kernel ESSIDs are printed using %pE, and I can't
    see why there should be an exception here.

    Signed-off-by: J. Bruce Fields
    Link: https://lore.kernel.org/r/1562799574-13315-1-git-send-email-bfields@redhat.com
    Signed-off-by: Greg Kroah-Hartman

    J. Bruce Fields
     
  • Fixes gcc '-Wunused-but-set-variable' warning:

    drivers/staging/rtl8192e/rtllib_rx.c: In function rtllib_rx_InfraAdhoc:
    drivers/staging/rtl8192e/rtllib_rx.c:1303:6: warning:
    variable payload set but not used [-Wunused-but-set-variable]

    Reported-by: Hulk Robot
    Signed-off-by: YueHaibing
    Link: https://lore.kernel.org/r/20190717143551.29200-1-yuehaibing@huawei.com
    Signed-off-by: Greg Kroah-Hartman

    YueHaibing
     

04 Jul, 2019

1 commit

  • Variable rtstatus is being initialized with a value that is never
    read as it is being overwritten inside a do-while loop. Clean up
    the code by removing the redundant initialization.

    Addresses-Coverity: ("Unused value")
    Signed-off-by: Colin Ian King
    Link: https://lore.kernel.org/r/20190702095647.26378-1-colin.king@canonical.com
    Signed-off-by: Greg Kroah-Hartman

    Colin Ian King
     

20 Jun, 2019

1 commit


20 May, 2019

1 commit

  • Fix following checkpatch.pl warnings by using %s and __func__
    in strings instead of function names.

    WARNING: Prefer using '"%s...", __func__' to using '_rtl92e_dm_check_rate_adaptive', this function's name, in a string
    WARNING: Prefer using '"%s...", __func__' to using 'rtl92e_dm_restore_state', this function's name, in a string

    Signed-off-by: Puranjay Mohan
    Signed-off-by: Greg Kroah-Hartman

    Puranjay Mohan
     

08 May, 2019

1 commit

  • Pull staging / IIO driver updates from Greg KH:
    "Here is the big staging and iio driver update for 5.2-rc1.

    Lots of tiny fixes all over the staging and IIO driver trees here,
    along with some new IIO drivers.

    The "counter" subsystem was added in here as well, as it is needed by
    the IIO drivers and subsystem.

    Also we ended up deleting two drivers, making this pull request remove
    a few hundred thousand lines of code, always a nice thing to see. Both
    of the drivers removed have been replaced with "real" drivers in their
    various subsystem directories, and they will be coming to you from
    those locations during this merge window.

    There are some core vt/selection changes in here, that was due to some
    cleanups needed for the speakup fixes. Those have all been acked by
    the various subsystem maintainers (i.e. me), so those are ok.

    We also added a few new drivers, for some odd hardware, giving new
    developers plenty to work on with basic coding style cleanups to come
    in the near future.

    Other than that, nothing unusual here.

    All of these have been in linux-next for a while with no reported
    issues, other than an odd gcc warning for one of the new drivers that
    should be fixed up soon"

    [ I fixed up the warning myself - Linus ]

    * tag 'staging-5.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (663 commits)
    staging: kpc2000: kpc_spi: Fix build error for {read,write}q
    Staging: rtl8192e: Remove extra space before break statement
    Staging: rtl8192u: ieee80211: Fix if-else indentation warning
    Staging: rtl8192u: ieee80211: Fix indentation errors by removing extra spaces
    staging: most: cdev: fix chrdev_region leak in mod_exit
    staging: wlan-ng: Fix improper SPDX comment style
    staging: rtl8192u: ieee80211: Resolve ERROR reported by checkpatch
    staging: vc04_services: bcm2835-camera: Compress two lines into one line
    staging: rtl8723bs: core: Use !x in place of NULL comparison.
    staging: rtl8723bs: core: Prefer using the BIT Macro.
    staging: fieldbus: anybus-s: fix wait_for_completion_timeout return handling
    staging: kpc2000: fix up build problems with readq()
    staging: rtlwifi: move remaining phydm .h files
    staging: rtlwifi: strip down phydm .h files
    staging: rtlwifi: delete the staging driver
    staging: fieldbus: anybus-s: rename bus id field to avoid confusion
    staging: fieldbus: anybus-s: keep device bus id in bus endianness
    Staging: sm750fb: Change *array into *const array
    staging: rtl8192u: ieee80211: Fix spelling mistake
    staging: rtl8192u: ieee80211: Replace bit shifting with BIT macro
    ...

    Linus Torvalds
     

03 May, 2019

1 commit


25 Apr, 2019

1 commit

  • The flags field in 'struct shash_desc' never actually does anything.
    The only ostensibly supported flag is CRYPTO_TFM_REQ_MAY_SLEEP.
    However, no shash algorithm ever sleeps, making this flag a no-op.

    With this being the case, inevitably some users who can't sleep wrongly
    pass MAY_SLEEP. These would all need to be fixed if any shash algorithm
    actually started sleeping. For example, the shash_ahash_*() functions,
    which wrap a shash algorithm with the ahash API, pass through MAY_SLEEP
    from the ahash API to the shash API. However, the shash functions are
    called under kmap_atomic(), so actually they're assumed to never sleep.

    Even if it turns out that some users do need preemption points while
    hashing large buffers, we could easily provide a helper function
    crypto_shash_update_large() which divides the data into smaller chunks
    and calls crypto_shash_update() and cond_resched() for each chunk. It's
    not necessary to have a flag in 'struct shash_desc', nor is it necessary
    to make individual shash algorithms aware of this at all.

    Therefore, remove shash_desc::flags, and document that the
    crypto_shash_*() functions can be called from any context.

    Signed-off-by: Eric Biggers
    Signed-off-by: Herbert Xu

    Eric Biggers
     

16 Apr, 2019

4 commits

  • 'default n' is the default value for any bool or tristate Kconfig
    setting so there is no need to write it explicitly.

    Also since commit f467c5640c29 ("kconfig: only write '# CONFIG_FOO
    is not set' for visible symbols") the Kconfig behavior is the same
    regardless of 'default n' being present or not:

    ...
    One side effect of (and the main motivation for) this change is making
    the following two definitions behave exactly the same:

    config FOO
    bool

    config FOO
    bool
    default n

    With this change, neither of these will generate a
    '# CONFIG_FOO is not set' line (assuming FOO isn't selected/implied).
    That might make it clearer to people that a bare 'default n' is
    redundant.
    ...

    Signed-off-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: Greg Kroah-Hartman

    Bartlomiej Zolnierkiewicz
     
  • Fix the checkpath error:
    CHECK: Blank lines aren't necessary after an open brace '{'

    Signed-off-by: Daniel Junho
    Signed-off-by: Greg Kroah-Hartman

    Daniel Junho
     
  • Fix a coding style issue.

    Signed-off-by: Gabriela Bittencourt
    Signed-off-by: Greg Kroah-Hartman

    Gabriela Bittencourt
     
  • Fixes gcc '-Wunused-but-set-variable' warning:

    drivers/staging/rtl8192e/rtl8192e/rtl_pci.c: In function 'rtl92e_check_adapter':
    drivers/staging/rtl8192e/rtl8192e/rtl_pci.c:36:6: warning:
    variable 'VenderID' set but not used [-Wunused-but-set-variable]
    u16 VenderID;
    ^

    It's never used and can be removed.

    Signed-off-by: YueHaibing
    Reviewed-by: Mukesh Ojha
    Signed-off-by: Greg Kroah-Hartman

    YueHaibing
     

03 Apr, 2019

4 commits


30 Mar, 2019

1 commit

  • Challenge suggested by coccinelle.
    Remove unnecessary parentheses around the right hand of
    assignment using the below script.

    @@
    local idexpression id;
    expression e;
    @@

    id =
    -(
    e
    -)

    @@ expression e, e1, e2,e3,e4; @@
    e =
    -(((e1) & (e2)) |
    -(e3 << e4))
    +(e1 & e2) |
    +(e3 << e4)

    Signed-off-by: Sanjana Sanikommu
    Signed-off-by: Greg Kroah-Hartman

    Sanjana Sanikommu
     

22 Mar, 2019

1 commit


19 Mar, 2019

1 commit

  • Avoid useless parentheses to the right hand side of an assignment.
    Issue found using coccinelle.
    The semantic patch that fixes the problem is as follows

    //
    @r1 disable paren@
    expression value,e;
    @@

    (
    - value = (e)
    + value = e
    )

    @r2 depends on r1@
    expression value,e;
    constant c;
    @@

    (
    - value = (e == c)
    + value = (e == c)
    |
    - value = (e = c)
    + value = (e >= c)
    |
    - value = (e != c)
    + value = (e != c)
    )
    //

    Signed-off-by: Bhanusree Pola
    Signed-off-by: Greg Kroah-Hartman

    Bhanusree Pola
     

18 Mar, 2019

2 commits


01 Mar, 2019

1 commit


21 Feb, 2019

1 commit


19 Feb, 2019

1 commit

  • Fixes gcc '-Wunused-but-set-variable' warning:

    drivers/staging/rtl8192e/rtl8192e/rtl_core.c: In function '_rtl92e_tx':
    drivers/staging/rtl8192e/rtl8192e/rtl_core.c:1732:28: warning:
    variable 'broad_addr' set but not used [-Wunused-but-set-variable]

    drivers/staging/rtl8192e/rtl8192e/rtl_core.c:1731:24: warning:
    variable 'stype' set but not used [-Wunused-but-set-variable]

    This remove unnessesary bool variable 'multi_addr, broad_addr, uni_addr'
    Also 'stype' never used and can be removed.

    Signed-off-by: YueHaibing
    Signed-off-by: Greg Kroah-Hartman

    YueHaibing
     

14 Feb, 2019

2 commits


11 Feb, 2019

6 commits


07 Feb, 2019

1 commit