18 Dec, 2019
1 commit
-
commit 09068c1ad53fb077bdac288869dec2435420bdc4 upstream.
Make sure that the interrupt interface has an endpoint before trying to
access its endpoint descriptors to avoid dereferencing a NULL pointer.The driver binds to the interrupt interface with interface number 0, but
must not assume that this interface or its current alternate setting are
the first entries in the corresponding configuration arrays.Fixes: b72458a80c75 ("[PATCH] USB: Eagle and ADI 930 usb adsl modem driver")
Cc: stable # 2.6.16
Signed-off-by: Johan Hovold
Link: https://lore.kernel.org/r/20191210112601.3561-2-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman
09 Aug, 2019
2 commits
-
USB drivers now support the ability for the driver core to handle the
creation and removal of device-specific sysfs files in a race-free
manner. Take advantage of that by converting the driver to use this by
moving the sysfs attributes into a group and assigning the dev_groups
pointer to it.Link: https://lore.kernel.org/r/20190806144502.17792-4-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman -
USB drivers now support the ability for the driver core to handle the
creation and removal of device-specific sysfs files in a race-free
manner. Take advantage of that by converting the driver to use this by
moving the sysfs attributes into a group and assigning the dev_groups
pointer to it.Cc: Matthieu CASTET
Cc: Stanislaw Gruszka
Link: https://lore.kernel.org/r/20190806144502.17792-5-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman
03 Jun, 2019
2 commits
-
Now that we have the correct SPDX tag for the ueagle-atm.c file, the
wall of "boiler-plate" text is not needed.This is done on a quest to remove the 700+ different ways that files in
the kernel describe the GPL license text. And there's unneeded stuff
like the address (sometimes incorrect) for the FSF which is never
needed.No copyright headers or other non-license-description text was removed.
Cc: Thomas Gleixner
Cc: Matthieu CASTET
Cc: Stanislaw Gruszka
Cc: Damien Bergamini
Cc: Duncan Sands
Signed-off-by: Greg Kroah-Hartman -
Thomas rightly points out that I got the BSD clause count wrong for this
driver, it should be 2, not 3 based on the text in the license here, so
fix that up.He also raises the question that the license text points to a v2 only
license, yet the text in the header says "or later". Given that the
text in the header says "or later" and all of the other USB atm drivers
are licensed in that way, I am going to leave the string as-is for that
mark.Reported-by: Thomas Gleixner
Cc: Matthieu CASTET
Cc: Stanislaw Gruszka
Cc: Damien Bergamini
Cc: Duncan Sands
Signed-off-by: Greg Kroah-Hartman
21 May, 2019
1 commit
-
'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
boolconfig FOO
bool
default nWith 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
22 Jan, 2019
1 commit
-
There are a few remaining drivers/usb/ files that do not have SPDX
identifiers in them, all of these are either Kconfig or Makefiles. Add
the correct GPL-2.0 identifier to them to make scanning tools happy.Signed-off-by: Greg Kroah-Hartman
24 Jan, 2018
3 commits
-
There's no need to have DEVICE_ATTR() in these crazy macros, so use the
proper DEVICE_ATTR_*() versions intead.Cc: Matthieu CASTET
Cc: Stanislaw Gruszka
Signed-off-by: Greg Kroah-Hartman -
Instead of "open coding" a DEVICE_ATTR() define, use the
DEVICE_ATTR_RO() macro instead, which does everything properly instead.This does require a few static functions to be renamed to work properly,
but thanks to a script from Joe Perches, this was easily done.Reported-by: Joe Perches
Cc: Matthieu CASTET
Cc: Stanislaw Gruszka
Cc: Oliver Neukum
Acked-by: Alan Stern
Acked-by: Felipe Balbi
Acked-by: Pete Zaitcev
Signed-off-by: Greg Kroah-Hartman -
Instead of "open coding" a DEVICE_ATTR() define, use the
DEVICE_ATTR_RW() macro instead, which does everything properly instead.This does require a few static functions to be renamed to work properly,
but thanks to a script from Joe Perches, this was easily done.Reported-by: Joe Perches
Cc: Matthieu CASTET
Cc: Stanislaw Gruszka
Cc: Peter Chen
Cc: Mathias Nyman
Acked-by: Felipe Balbi
Acked-by: Alan Stern
Acked-by: Bin Liu
Signed-off-by: Greg Kroah-Hartman
22 Nov, 2017
1 commit
-
In preparation for unconditionally passing the struct timer_list pointer to
all timer callbacks, switch to using the new timer_setup() and from_timer()
to pass the timer pointer explicitly. Additionally corrects and on-stack
timer usage.Cc: Greg Kroah-Hartman
Cc: Duncan Sands
Cc: "Gustavo A. R. Silva"
Cc: accessrunner-general@lists.sourceforge.net
Cc: linux-usb@vger.kernel.org
Signed-off-by: Kees Cook
Reviewed-by: Allen Pais
14 Nov, 2017
1 commit
-
Pull USB/PHY updates from Greg KH:
"Here is the big set of USB and PHY driver updates for 4.15-rc1.There is the usual amount of gadget and xhci driver updates, along
with phy and chipidea enhancements. There's also a lot of SPDX tags
and license boilerplate cleanups as well, which provide some churn in
the diffstat.Other major thing is the typec code that moved out of staging and into
the "real" part of the drivers/usb/ tree, which was nice to see
happen.All of these have been in linux-next with no reported issues for a
while"* tag 'usb-4.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (263 commits)
usb: gadget: f_fs: Fix use-after-free in ffs_free_inst
USB: usbfs: compute urb->actual_length for isochronous
usb: core: message: remember to reset 'ret' to 0 when necessary
USB: typec: Remove remaining redundant license text
USB: typec: add SPDX identifiers to some files
USB: renesas_usbhs: rcar?.h: add SPDX tags
USB: chipidea: ci_hdrc_tegra.c: add SPDX line
USB: host: xhci-debugfs: add SPDX lines
USB: add SPDX identifiers to all remaining Makefiles
usb: host: isp1362-hcd: remove a couple of redundant assignments
USB: adutux: remove redundant variable minor
usb: core: add a new usb_get_ptm_status() helper
usb: core: add a 'type' parameter to usb_get_status()
usb: core: introduce a new usb_get_std_status() helper
usb: core: rename usb_get_status() 'type' argument to 'recip'
usb: core: add Status Type definitions
USB: gadget: Remove redundant license text
USB: gadget: function: Remove redundant license text
USB: gadget: udc: Remove redundant license text
USB: gadget: legacy: Remove redundant license text
...
04 Nov, 2017
2 commits
-
Now that the SPDX tag is in all USB files, that identifies the license
in a specific and legally-defined manner. So the extra GPL text wording
can be removed as it is no longer needed at all.This is done on a quest to remove the 700+ different ways that files in
the kernel describe the GPL license text. And there's unneeded stuff
like the address (sometimes incorrect) for the FSF which is never
needed.No copyright headers or other non-license-description text was removed.
Cc: Duncan Sands
Signed-off-by: Greg Kroah-Hartman -
It's good to have SPDX identifiers in all files to make it easier to
audit the kernel tree for correct licenses.Update the drivers/usb/ and include/linux/usb* files with the correct
SPDX license identifier based on the license text in the file itself.
The SPDX identifier is a legally binding shorthand, which can be used
instead of the full boiler plate text.This work is based on a script and data from Thomas Gleixner, Philippe
Ombredanne, and Kate Stewart.Cc: Thomas Gleixner
Cc: Kate Stewart
Cc: Philippe Ombredanne
Signed-off-by: Greg Kroah-Hartman
Acked-by: Felipe Balbi
Acked-by: Johan Hovold
Signed-off-by: Greg Kroah-Hartman
02 Nov, 2017
1 commit
-
Many source files in the tree are missing licensing information, which
makes it harder for compliance tools to determine the correct license.By default all files without license information are under the default
license of the kernel, which is GPL version 2.Update the files which contain no license information with the 'GPL-2.0'
SPDX license identifier. The SPDX identifier is a legally binding
shorthand, which can be used instead of the full boiler plate text.This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne.How this work was done:
Patches were generated and checked against linux-4.14-rc6 for a subset of
the use cases:
- file had no licensing information it it.
- file was a */uapi/* one with no licensing information in it,
- file was a */uapi/* one with existing licensing information,Further patches will be generated in subsequent months to fix up cases
where non-standard license headers were used, and references to license
had to be inferred by heuristics based on keywords.The analysis to determine which SPDX License Identifier to be applied to
a file was done in a spreadsheet of side by side results from of the
output of two independent scanners (ScanCode & Windriver) producing SPDX
tag:value files created by Philippe Ombredanne. Philippe prepared the
base worksheet, and did an initial spot review of a few 1000 files.The 4.13 kernel was the starting point of the analysis with 60,537 files
assessed. Kate Stewart did a file by file comparison of the scanner
results in the spreadsheet to determine which SPDX license identifier(s)
to be applied to the file. She confirmed any determination that was not
immediately clear with lawyers working with the Linux Foundation.Criteria used to select files for SPDX license identifier tagging was:
- Files considered eligible had to be source code files.
- Make and config files were included as candidates if they contained >5
lines of source
- File already had some variant of a license header in it (even if
Reviewed-by: Philippe Ombredanne
Reviewed-by: Thomas Gleixner
Signed-off-by: Greg Kroah-Hartman
27 Oct, 2017
1 commit
-
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.Signed-off-by: Gustavo A. R. Silva
Signed-off-by: Greg Kroah-Hartman
04 Oct, 2017
2 commits
-
Use setup_timer function instead of initializing timer with the
function and data fields.Signed-off-by: Allen Pais
Signed-off-by: Greg Kroah-Hartman -
Use setup_timer function instead of initializing timer with the
function and data fields.Signed-off-by: Allen Pais
Signed-off-by: Greg Kroah-Hartman
11 Aug, 2017
3 commits
-
attribute_group are not supposed to change at runtime. All functions
working with attribute_group provided by work with
const attribute_group. So mark the non-const structs as const.Signed-off-by: Arvind Yadav
Signed-off-by: Greg Kroah-Hartman -
Make these const as they are only passed to the function
atm_dev_register and the corresponding argument is of type const.
Done using Coccinelle.Signed-off-by: Bhumika Goyal
Signed-off-by: Greg Kroah-Hartman -
usb_device_id are not supposed to change at runtime. All functions
working with usb_device_id provided by work with
const usb_device_id. So mark the non-const structs as const.Signed-off-by: Arvind Yadav
Signed-off-by: Greg Kroah-Hartman
22 Jul, 2017
1 commit
-
MODULE_VERSION is useless for in-kernel drivers, so just remove all
usage of it in the USB ATM drivers. Along with this, some
DRIVER_VERSION macros were removed as they are also pointless.Cc: Duncan Sands
Signed-off-by: Greg Kroah-Hartman
17 Jul, 2017
1 commit
-
Trivial fix to spelling mistake in uea_err error message
Signed-off-by: Colin Ian King
Signed-off-by: Greg Kroah-Hartman
16 Mar, 2017
1 commit
-
'index' is an unsigned variable, and less-than-zero comparison of an unsigned
variable is never true.Addresses-Coverity-ID: 115396
Signed-off-by: Gustavo A. R. Silva
Signed-off-by: Greg Kroah-Hartman
02 Mar, 2017
1 commit
-
We are going to split out of , which
will have to be picked up from other headers and a couple of .c files.Create a trivial placeholder file that just
maps to to make this patch obviously correct and
bisectable.Include the new header in the files that are going to need it.
Acked-by: Linus Torvalds
Cc: Mike Galbraith
Cc: Peter Zijlstra
Cc: Thomas Gleixner
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar
25 Dec, 2016
1 commit
-
This was entirely automated, using the script by Al:
PATT='^[[:blank:]]*#[[:blank:]]*include[[:blank:]]*'
sed -i -e "s!$PATT!#include !" \
$(git grep -l "$PATT"|grep -v ^include/linux/uaccess.h)to do the replacement at the end of the merge window.
Requested-by: Al Viro
Signed-off-by: Linus Torvalds
31 Aug, 2016
4 commits
-
All kmalloc-based functions print enough information on failures.
Signed-off-by: Wolfram Sang
Signed-off-by: Greg Kroah-Hartman -
All kmalloc-based functions print enough information on failures.
Signed-off-by: Wolfram Sang
Signed-off-by: Greg Kroah-Hartman -
All kmalloc-based functions print enough information on failures.
Signed-off-by: Wolfram Sang
Signed-off-by: Greg Kroah-Hartman -
All kmalloc-based functions print enough information on failures.
Signed-off-by: Wolfram Sang
Signed-off-by: Greg Kroah-Hartman
15 Aug, 2016
3 commits
-
kmalloc will print enough information in case of failure.
Signed-off-by: Wolfram Sang
Signed-off-by: Greg Kroah-Hartman -
kmalloc will print enough information in case of failure.
Signed-off-by: Wolfram Sang
Signed-off-by: Greg Kroah-Hartman -
kmalloc will print enough information in case of failure.
Signed-off-by: Wolfram Sang
Signed-off-by: Greg Kroah-Hartman
29 Apr, 2016
2 commits
-
Use "foo *bar" instead of "foo * bar".
Signed-off-by: Sandhya Bankar
Signed-off-by: Greg Kroah-Hartman -
Remove unnecessary space before function pointer arguments.
Signed-off-by: Sandhya Bankar
Signed-off-by: Greg Kroah-Hartman
04 Feb, 2016
1 commit
-
This is a privileged operation so it doesn't matter much. We use "tmp"
as an offset into an array. If it were invalid we could read out of
bounds and trigger an oops if the memory is not mapped. Plus it makes
static checkers complain.Signed-off-by: Dan Carpenter
Signed-off-by: Greg Kroah-Hartman
23 Jul, 2015
1 commit
-
Fixed a coding style issue. Adds blank lines after declarations.
Signed-off-by: Aaron Raimist
Signed-off-by: Greg Kroah-Hartman
02 Jul, 2015
1 commit
-
Pull module updates from Rusty Russell:
"Main excitement here is Peter Zijlstra's lockless rbtree optimization
to speed module address lookup. He found some abusers of the module
lock doing that too.A little bit of parameter work here too; including Dan Streetman's
breaking up the big param mutex so writing a parameter can load
another module (yeah, really). Unfortunately that broke the usual
suspects, !CONFIG_MODULES and !CONFIG_SYSFS, so those fixes were
appended too"* tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux: (26 commits)
modules: only use mod->param_lock if CONFIG_MODULES
param: fix module param locks when !CONFIG_SYSFS.
rcu: merge fix for Convert ACCESS_ONCE() to READ_ONCE() and WRITE_ONCE()
module: add per-module param_lock
module: make perm const
params: suppress unused variable error, warn once just in case code changes.
modules: clarify CONFIG_MODULE_COMPRESS help, suggest 'N'.
kernel/module.c: avoid ifdefs for sig_enforce declaration
kernel/workqueue.c: remove ifdefs over wq_power_efficient
kernel/params.c: export param_ops_bool_enable_only
kernel/params.c: generalize bool_enable_only
kernel/module.c: use generic module param operaters for sig_enforce
kernel/params: constify struct kernel_param_ops uses
sysfs: tightened sysfs permission checks
module: Rework module_addr_{min,max}
module: Use __module_address() for module_address_lookup()
module: Make the mod_tree stuff conditional on PERF_EVENTS || TRACING
module: Optimize __module_address() using a latched RB-tree
rbtree: Implement generic latch_tree
seqlock: Introduce raw_read_seqcount_latch()
...
23 Jun, 2015
1 commit
-
Add a "param_lock" mutex to each module, and update params.c to use
the correct built-in or module mutex while locking kernel params.
Remove the kparam_block_sysfs_r/w() macros, replace them with direct
calls to kernel_param_[un]lock(module).The kernel param code currently uses a single mutex to protect
modification of any and all kernel params. While this generally works,
there is one specific problem with it; a module callback function
cannot safely load another module, i.e. with request_module() or even
with indirect calls such as crypto_has_alg(). If the module to be
loaded has any of its params configured (e.g. with a /etc/modprobe.d/*
config file), then the attempt will result in a deadlock between the
first module param callback waiting for modprobe, and modprobe trying to
lock the single kernel param mutex to set the new module's param.This fixes that by using per-module mutexes, so that each individual module
is protected against concurrent changes in its own kernel params, but is
not blocked by changes to other module params. All built-in modules
continue to use the built-in mutex, since they will always be loaded at
runtime and references (e.g. request_module(), crypto_has_alg()) to them
will never cause load-time param changing.This also simplifies the interface used by modules to block sysfs access
to their params; while there are currently functions to block and unblock
sysfs param access which are split up by read and write and expect a single
kernel param to be passed, their actual operation is identical and applies
to all params, not just the one passed to them; they simply lock and unlock
the global param mutex. They are replaced with direct calls to
kernel_param_[un]lock(THIS_MODULE), which locks THIS_MODULE's param_lock, or
if the module is built-in, it locks the built-in mutex.Suggested-by: Rusty Russell
Signed-off-by: Dan Streetman
Signed-off-by: Rusty Russell
10 May, 2015
1 commit
-
We should not be doing assignments within an if () block
so fix up the code to not do this.change was created using Coccinelle.
Signed-off-by: Greg Kroah-Hartman
Reviewed-by: Felipe Balbi