Linux 4.9.199
Greg KH
maintainerI'm announcing the release of the 4.9.199 kernel.
All users of the 4.9 kernel series must upgrade.
The updated 4.9.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.9.y
and can be browsed at the normal kernel.org git web browser:
https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Makefile | 2 arch/mips/fw/sni/sniprom.c | 2 arch/s390/include/asm/uaccess.h | 4 arch/s390/mm/cmm.c | 12 - arch/x86/include/asm/intel-family.h | 3 arch/x86/platform/efi/efi.c | 3 drivers/dma/cppi41.c | 21 +++ drivers/firmware/efi/cper.c | 2 drivers/gpio/gpio-max77620.c | 6 drivers/hid/hid-axff.c | 11 + drivers/hid/hid-core.c | 7 - drivers/hid/hid-dr.c | 12 + drivers/hid/hid-emsff.c | 12 + drivers/hid/hid-gaff.c | 12 + drivers/hid/hid-holtekff.c | 12 + drivers/hid/hid-lg2ff.c | 12 + drivers/hid/hid-lg3ff.c | 11 + drivers/hid/hid-lg4ff.c | 11 + drivers/hid/hid-lgff.c | 11 + drivers/hid/hid-logitech-hidpp.c | 11 + drivers/hid/hid-sony.c | 12 + drivers/hid/hid-tmff.c | 12 + drivers/hid/hid-zpff.c | 12 + drivers/hid/i2c-hid/i2c-hid-dmi-quirks.c | 35 +++++ drivers/iio/accel/bmc150-accel-core.c | 2 drivers/infiniband/core/cma.c | 3 drivers/md/dm-bio-prison.c | 2 drivers/md/dm-io.c | 2 drivers/md/dm-kcopyd.c | 2 drivers/md/dm-region-hash.c | 2 drivers/md/dm-snap.c | 178 ++++++++++++++++++---------- drivers/md/dm-thin.c | 2 drivers/net/bonding/bond_main.c | 2 drivers/net/usb/sr9800.c | 2 drivers/net/wireless/ath/ath6kl/usb.c | 8 + drivers/net/wireless/realtek/rtlwifi/ps.c | 6 drivers/rtc/rtc-pcf8523.c | 28 +++- drivers/staging/rtl8188eu/os_dep/usb_intf.c | 6 drivers/thunderbolt/nhi.c | 22 ++- drivers/tty/serial/sc16is7xx.c | 28 ++++ drivers/tty/serial/serial_mctrl_gpio.c | 3 drivers/usb/core/hub.c | 7 + drivers/usb/gadget/udc/core.c | 11 + drivers/usb/misc/ldusb.c | 6 drivers/usb/misc/legousbtower.c | 2 drivers/usb/serial/whiteheat.c | 13 +- drivers/usb/serial/whiteheat.h | 2 drivers/usb/storage/scsiglue.c | 10 - drivers/usb/storage/uas.c | 20 --- fs/binfmt_script.c | 57 +++++++- fs/cifs/netmisc.c | 4 fs/fuse/dir.c | 13 ++ fs/fuse/file.c | 10 + fs/nfs/nfs4proc.c | 1 fs/ocfs2/aops.c | 25 +++ fs/ocfs2/ioctl.c | 2 fs/ocfs2/xattr.c | 56 +++----- fs/xfs/xfs_buf.c | 2 include/net/llc_conn.h | 2 include/net/sch_generic.h | 5 include/net/sctp/sctp.h | 2 include/sound/timer.h | 2 kernel/trace/trace.c | 1 net/llc/llc_c_ac.c | 8 - net/llc/llc_conn.c | 32 +---- net/llc/llc_s_ac.c | 12 + net/llc/llc_sap.c | 23 +-- net/sched/sch_netem.c | 2 net/sctp/ipv6.c | 2 net/sctp/protocol.c | 2 net/sctp/socket.c | 55 ++++---- net/wireless/nl80211.c | 3 scripts/setlocalversion | 12 + sound/core/hrtimer.c | 1 sound/core/timer.c | 141 +++++++++++++++------- sound/firewire/bebob/bebob_stream.c | 3 sound/hda/hdac_controller.c | 2 sound/pci/hda/hda_intel.c | 2 tools/perf/pmu-events/jevents.c | 12 - tools/perf/util/map.c | 3 80 files changed, 754 insertions(+), 360 deletions(-)
Adam Ford (1):
serial: mctrl_gpio: Check for NULL pointer
Alan Stern (4):
UAS: Revert commit 3ae62a42090f ("UAS: fix alignment of scatter/gather segments")
USB: gadget: Reject endpoints with 0 maxpacket value
usb-storage: Revert commit 747668dbc061 ("usb-storage: Set virt_boundary_mask to avoid SG overflows")
HID: Fix assumption that devices have inputs
Andi Kleen (1):
perf jevents: Fix period for Intel fixed counters
Austin Kim (1):
fs: cifs: mute -Wunused-const-variable message
Bart Van Assche (1):
RDMA/iwcm: Fix a lock inversion issue
Brian Norris (1):
scripts/setlocalversion: Improve -dirty check with git-status --no-optional-locks
Christian Borntraeger (1):
s390/uaccess: avoid (false positive) compiler warnings
Chuck Lever (1):
NFSv4: Fix leak of clp->cl_acceptor string
Connor Kuehl (1):
staging: rtl8188eu: fix null dereference when kzalloc fails
Dan Carpenter (1):
USB: legousbtower: fix a signedness bug in tower_probe()
Dave Young (1):
efi/x86: Do not clean dummy variable in kexec path
Eric Biggers (2):
llc: fix sk_buff leak in llc_sap_state_process()
llc: fix sk_buff leak in llc_conn_service()
Eric Dumazet (2):
bonding: fix potential NULL deref in bond_update_slave_arr
sch_netem: fix rcu splat in netem_enqueue()
Greg Kroah-Hartman (1):
Linux 4.9.199
Hans de Goede (2):
HID: i2c-hid: Add Odys Winbook 13 to descriptor override
HID: i2c-hid: add Trekstor Primebook C11B to descriptor override
Hui Peng (1):
ath6kl: fix a NULL-ptr-deref bug in ath6kl_usb_alloc_urb_from_pipe()
Jan-Marek Glogowski (1):
usb: handle warm-reset port requests on hub resume
Jia Guo (1):
ocfs2: clear zero in unaligned direct IO
Jia-Ju Bai (3):
fs: ocfs2: fix possible null-pointer dereferences in ocfs2_xa_prepare_entry()
fs: ocfs2: fix a possible null-pointer dereference in ocfs2_write_end_nolock()
fs: ocfs2: fix a possible null-pointer dereference in ocfs2_info_scan_inode_alloc()
Johan Hovold (4):
USB: ldusb: fix ring-buffer locking
USB: ldusb: fix control-message timeout
USB: serial: whiteheat: fix potential slab corruption
USB: serial: whiteheat: fix line-speed endianness
Julian Sax (1):
HID: i2c-hid: add Direkt-Tek DTLAPY133-1 to descriptor override
Kan Liang (1):
x86/cpu: Add Atom Tremont (Jacobsville)
Kees Cook (1):
exec: load_script: Do not exec truncated interpreter path
Kent Overstreet (1):
dm: Use kzalloc for all structs with embedded biosets/mempools
Laura Abbott (1):
rtlwifi: Fix potential overflow on P2P code
Lukas Wunner (1):
efi/cper: Fix endianness of PCIe class code
Markus Theil (1):
nl80211: fix validation of mesh path nexthop
Michał Mirosław (1):
HID: fix error message in hid_open_report()
Mika Westerberg (1):
thunderbolt: Use 32-bit writes when writing ring producer/consumer
Miklos Szeredi (2):
fuse: flush dirty data/metadata before non-truncate setattr
fuse: truncate pending writes on O_TRUNC
Mikulas Patocka (3):
dm snapshot: use mutex instead of rw_semaphore
dm snapshot: introduce account_start_copy() and account_end_copy() dm snapshot: rework COW throttling to fix deadlock
Pascal Bouwmann (1):
iio: fix center temperature of bmc150-accel-core
Petr Mladek (1):
tracing: Initialize iter->seq after zeroing in tracing_read_pipe()
Phil Elwell (1):
sc16is7xx: Fix for "Unexpected interrupt: 8"
Sam Ravnborg (1):
rtc: pcf8523: set xtal load capacitance from DT
Steve MacLean (1):
perf map: Fix overlapped map handling
Takashi Iwai (5):
ALSA: timer: Follow standard EXPORT_SYMBOL() declarations
ALSA: timer: Limit max instances per timer
ALSA: timer: Simplify error path in snd_timer_open()
ALSA: timer: Fix mutex deadlock at releasing card Revert "ALSA: hda: Flush interrupts on disabling"
Takashi Sakamoto (1):
ALSA: bebob: Fix prototype of helper function to return negative value
Thierry Reding (1):
gpio: max77620: Use correct unit for debounce times
Thomas Bogendoerfer (1):
MIPS: fw: sni: Fix out of bounds init of o32 stack
Tony Lindgren (1):
dmaengine: cppi41: Fix cppi41_dma_prep_slave_sg() when idle
Valentin Vidic (1):
net: usb: sr9800: fix uninitialized local variable
Vratislav Bendel (1):
xfs: Correctly invert xfs_buftarg LRU isolation logic
Xin Long (2):
sctp: fix the issue that flags are ignored when using kernel_connect
sctp: not bind the socket in sctp_connect
Yihui ZENG (1):
s390/cmm: fix information leak in cmm_timeout_handler()
Greg KH
maintainerMakefile +1 -1
@@ -1,6 +1,6 @@ VERSION = 4 PATCHLEVEL = 9 -SUBLEVEL = 198 +SUBLEVEL = 199 EXTRAVERSION = NAME = Roaring Lionus
arch/mips/fw/sni/sniprom.c +1 -1
@@ -42,7 +42,7 @@/* O32 stack has to be 8-byte aligned. */ static u64 o32_stk[4096 ]; -#define O32_STK &o32_stk[sizeof(o32_stk)] +#define O32_STK (&o32_stk[ARRAY_SIZE(o32_stk)])#define __PROM_O32 (fun, arg) fun arg __asm__(#fun); \ __asm__(#fun " = call_o32")
arch/s390/include/asm/uaccess.h +2 -2
@@ -151,7 +151,7 @@ unsigned long __must_check __copy_to_user(void __user *to, const void *from, __rc; \ }) -static inline int __put_user_fn (void *x,void __user *ptr,unsigned long size) +static __always_inline int __put_user_fn(void *x, void __user *ptr, unsigned long size) {unsigned long spec =0x810000UL ;int rc;
@@ -181,7 +181,7 @@ static inline int __put_user_fn(void *x, void __user *ptr, unsigned long size)return rc; } -static inline int __get_user_fn (void *x,const void __user *ptr,unsigned long size) +static __always_inline int __get_user_fn(void *x, const void __user *ptr, unsigned long size) {unsigned long spec =0x81UL ;int rc;
arch/s390/mm/cmm.c +6 -6
@@ -306,16 +306,16 @@ static int cmm_timeout_handler(struct ctl_table *ctl, int write, }if (write) { - len = *lenp; -if (copy_from_user (buf, buffer, - len >sizeof (buf) ?sizeof (buf) : len)) + len =min (*lenp,sizeof (buf)); +if (copy_from_user (buf, buffer, len))return -EFAULT ; - buf[sizeof (buf) -1 ] ='\0' ; + buf[len -1 ] ='\0' ;cmm_skip_blanks (buf, &p); nr =simple_strtoul (p, &p,0 );cmm_skip_blanks (p, &p); seconds =simple_strtoul (p, &p,0 );cmm_set_timeout (nr, seconds); + *ppos += *lenp; }else { len =sprintf (buf,"%ld %ld\n" , cmm_timeout_pages, cmm_timeout_seconds);
@@ -323,9 +323,9 @@ static int cmm_timeout_handler(struct ctl_table *ctl, int write, len = *lenp;if (copy_to_user (buffer, buf, len))return -EFAULT ; + *lenp = len; + *ppos += len; } - *lenp = len; - *ppos += len;return 0 ; }
arch/x86/include/asm/intel-family.h +2 -1
@@ -5,7 +5,7 @@* "Big Core" Processors (Branded as Core, Xeon, etc...) * * The "_X" parts are generally the EP and EX Xeons, or the -* "Extreme" ones, like Broadwell-E. +* "Extreme" ones, like Broadwell-E, or Atom microserver. * * Things ending in "2" are usually because we have no better * name for them. There's no processor called "SILVERMONT2".
@@ -67,6 +67,7 @@#define INTEL_FAM6_ATOM_GOLDMONT 0x5C/* Apollo Lake */ #define INTEL_FAM6_ATOM_GOLDMONT_X 0x5F/* Denverton */ #define INTEL_FAM6_ATOM_GOLDMONT_PLUS 0x7A/* Gemini Lake */ +#define INTEL_FAM6_ATOM_TREMONT_X 0x86/* Jacobsville */ /* Xeon Phi */
arch/x86/platform/efi/efi.c +0 -3
@@ -896,9 +896,6 @@ static void __init kexec_enter_virtual_mode(void)if (efi_enabled (EFI_OLD_MEMMAP ) && (__supported_pte_mask & _PAGE_NX))runtime_code_page_mkexec (); - -/* clean DUMMY object */ -efi_delete_dummy_variable ();#endif }
drivers/dma/cppi41.c +20 -1
@@ -586,9 +586,22 @@ static struct dma_async_tx_descriptor *cppi41_dma_prep_slave_sg( enum dma_transfer_direction dir, unsigned long tx_flags, void *context) { struct cppi41_channel *c = to_cpp41_chan(chan); +struct dma_async_tx_descriptor *txd =NULL ; +struct cppi41_dd *cdd = c->cdd;struct cppi41_desc *d;struct scatterlist *sg;unsigned int i; +int error; + + error =pm_runtime_get (cdd->ddev.dev); +if (error <0 ) { +pm_runtime_put_noidle (cdd->ddev.dev); + +return NULL ; + } + +if (cdd->is_suspended) + goto err_out_not_ready; d = c->desc;for_each_sg (sgl, sg, sg_len, i) {
@@ -611,7 +624,13 @@ static struct dma_async_tx_descriptor *cppi41_dma_prep_slave_sg( d++; } -return &c->txd; + txd = &c->txd; + +err_out_not_ready: +pm_runtime_mark_last_busy (cdd->ddev.dev); +pm_runtime_put_autosuspend (cdd->ddev.dev); + +return txd; }static void cppi41_compute_td_desc (struct cppi41_desc *d)
drivers/firmware/efi/cper.c +1 -1
@@ -375,7 +375,7 @@ static void cper_print_pcie(const char *pfx, const struct cper_sec_pcie *pcie,printk ("%s""vendor_id: 0x%04x, device_id: 0x%04x\n" , pfx, pcie->device_id.vendor_id, pcie->device_id.device_id); p = pcie->device_id.class_code; -printk ("%s""class_code: %02x%02x%02x\n" , pfx, p[0 ], p[1 ], p[2 ]); +printk ("%s""class_code: %02x%02x%02x\n" , pfx, p[2 ], p[1 ], p[0 ]); }if (pcie->validation_bits &CPER_PCIE_VALID_SERIAL_NUMBER ) printk("%s""serial number: 0x%04x, 0x%04x\n", pfx,
drivers/gpio/gpio-max77620.c +3 -3
@@ -167,13 +167,13 @@ static int max77620_gpio_set_debounce(struct gpio_chip *gc,case 0 : val = MAX77620_CNFG_GPIO_DBNC_None;break ; - case 1 ... 8: + case 1000 ... 8000: val = MAX77620_CNFG_GPIO_DBNC_8ms;break ; - case 9 ... 16: + case 9000 ... 16000: val = MAX77620_CNFG_GPIO_DBNC_16ms;break ; - case 17 ... 32: + case 17000 ... 32000: val = MAX77620_CNFG_GPIO_DBNC_32ms;break ;default :
drivers/hid/hid-axff.c +9 -2
@@ -75,13 +75,20 @@ static int axff_init(struct hid_device *hid) {struct axff_device *axff;struct hid_report *report; - struct hid_input *hidinput = list_first_entry(&hid->inputs, struct hid_input, list); +struct hid_input *hidinput;struct list_head *report_list =&hid->report_enum[HID_OUTPUT_REPORT ].report_list; -struct input_dev *dev = hidinput->input; +struct input_dev *dev;int field_count =0 ;int i, j;int error; +if (list_empty (&hid->inputs)) { +hid_err (hid,"no inputs found\n" ); +return -ENODEV ; + } + hidinput = list_first_entry(&hid->inputs, struct hid_input, list); + dev = hidinput->input; +if (list_empty (report_list)) {hid_err (hid,"no output reports found\n" );return -ENODEV ;
drivers/hid/hid-core.c +5 -2
@@ -959,6 +959,7 @@ int hid_open_report(struct hid_device *device)__u8 *start;__u8 *buf;__u8 *end; +__u8 *next;int ret;static int (*dispatch_type[])(struct hid_parser *parser,struct hid_item *item) = {
@@ -1012,7 +1013,8 @@ int hid_open_report(struct hid_device *device) device->collection_size =HID_DEFAULT_NUM_COLLECTIONS ; ret = -EINVAL ; -while ((start =fetch_item (start, end, &item)) !=NULL ) { +while ((next =fetch_item (start, end, &item)) !=NULL ) { + start = next;if (item.format !=HID_ITEM_FORMAT_SHORT ) {hid_err (device,"unexpected long global item\n" );
@@ -1041,7 +1043,8 @@ int hid_open_report(struct hid_device *device) } } -hid_err (device,"item fetching failed at offset %d\n" , (int )(end - start)); +hid_err (device,"item fetching failed at offset %u/%u\n" , + size - (unsigned int )(end - start), size); err:vfree (parser);hid_close_report (device);
drivers/hid/hid-dr.c +9 -3
@@ -87,13 +87,19 @@ static int drff_init(struct hid_device *hid) {struct drff_device *drff;struct hid_report *report; -struct hid_input *hidinput =list_first_entry (&hid->inputs, - struct hid_input, list); +struct hid_input *hidinput;struct list_head *report_list = &hid->report_enum[HID_OUTPUT_REPORT ].report_list; -struct input_dev *dev = hidinput->input; +struct input_dev *dev;int error; +if (list_empty (&hid->inputs)) { +hid_err (hid,"no inputs found\n" ); +return -ENODEV ; + } + hidinput = list_first_entry(&hid->inputs, struct hid_input, list); + dev = hidinput->input; +if (list_empty (report_list)) {hid_err (hid,"no output reports found\n" );return -ENODEV ;
drivers/hid/hid-emsff.c +9 -3
@@ -59,13 +59,19 @@ static int emsff_init(struct hid_device *hid) {struct emsff_device *emsff;struct hid_report *report; -struct hid_input *hidinput =list_first_entry (&hid->inputs, - struct hid_input, list); +struct hid_input *hidinput;struct list_head *report_list = &hid->report_enum[HID_OUTPUT_REPORT ].report_list; -struct input_dev *dev = hidinput->input; +struct input_dev *dev;int error; +if (list_empty (&hid->inputs)) { +hid_err (hid,"no inputs found\n" ); +return -ENODEV ; + } + hidinput = list_first_entry(&hid->inputs, struct hid_input, list); + dev = hidinput->input; +if (list_empty (report_list)) {hid_err (hid,"no output reports found\n" );return -ENODEV ;
drivers/hid/hid-gaff.c +9 -3
@@ -77,14 +77,20 @@ static int gaff_init(struct hid_device *hid) {struct gaff_device *gaff;struct hid_report *report; -struct hid_input *hidinput =list_entry (hid->inputs.next, - struct hid_input, list); +struct hid_input *hidinput;struct list_head *report_list = &hid->report_enum[HID_OUTPUT_REPORT ].report_list;struct list_head *report_ptr = report_list; -struct input_dev *dev = hidinput->input; +struct input_dev *dev;int error; +if (list_empty (&hid->inputs)) { +hid_err (hid,"no inputs found\n" ); +return -ENODEV ; + } + hidinput = list_entry(hid->inputs.next, struct hid_input, list); + dev = hidinput->input; +if (list_empty (report_list)) {hid_err (hid,"no output reports found\n" );return -ENODEV ;
drivers/hid/hid-holtekff.c +9 -3
@@ -140,13 +140,19 @@ static int holtekff_init(struct hid_device *hid) {struct holtekff_device *holtekff;struct hid_report *report; -struct hid_input *hidinput =list_entry (hid->inputs.next, - struct hid_input, list); +struct hid_input *hidinput;struct list_head *report_list = &hid->report_enum[HID_OUTPUT_REPORT ].report_list; -struct input_dev *dev = hidinput->input; +struct input_dev *dev;int error; +if (list_empty (&hid->inputs)) { +hid_err (hid,"no inputs found\n" ); +return -ENODEV ; + } + hidinput = list_entry(hid->inputs.next, struct hid_input, list); + dev = hidinput->input; +if (list_empty (report_list)) {hid_err (hid,"no output report found\n" );return -ENODEV ;
drivers/hid/hid-lg2ff.c +9 -3
@@ -62,11 +62,17 @@ int lg2ff_init(struct hid_device *hid) {struct lg2ff_device *lg2ff;struct hid_report *report; -struct hid_input *hidinput =list_entry (hid->inputs.next, - struct hid_input, list); -struct input_dev *dev = hidinput->input; +struct hid_input *hidinput; +struct input_dev *dev;int error; +if (list_empty (&hid->inputs)) { +hid_err (hid,"no inputs found\n" ); +return -ENODEV ; + } + hidinput = list_entry(hid->inputs.next, struct hid_input, list); + dev = hidinput->input; +/* Check that the report looks ok */ report =hid_validate_values (hid,HID_OUTPUT_REPORT ,0 ,0 ,7 );if (!report)
drivers/hid/hid-lg3ff.c +9 -2
@@ -129,12 +129,19 @@ static const signed short ff3_joystick_ac[] = {int lg3ff_init (struct hid_device *hid) { - struct hid_input *hidinput = list_entry(hid->inputs.next, struct hid_input, list); -struct input_dev *dev = hidinput->input; +struct hid_input *hidinput; +struct input_dev *dev;const signed short *ff_bits = ff3_joystick_ac;int error;int i; +if (list_empty (&hid->inputs)) { +hid_err (hid,"no inputs found\n" ); +return -ENODEV ; + } + hidinput = list_entry(hid->inputs.next, struct hid_input, list); + dev = hidinput->input; +/* Check that the report looks ok */ if (!hid_validate_values (hid,HID_OUTPUT_REPORT ,0 ,0 ,35 ))return -ENODEV ;
drivers/hid/hid-lg4ff.c +9 -2
@@ -1261,8 +1261,8 @@ static int lg4ff_handle_multimode_wheel(struct hid_device *hid, u16 *real_producint lg4ff_init (struct hid_device *hid) { - struct hid_input *hidinput = list_entry(hid->inputs.next, struct hid_input, list); -struct input_dev *dev = hidinput->input; +struct hid_input *hidinput; +struct input_dev *dev;struct list_head *report_list = &hid->report_enum[HID_OUTPUT_REPORT ].report_list; struct hid_report *report = list_entry(report_list->next, struct hid_report, list);const struct usb_device_descriptor *udesc = &(hid_to_usb_dev (hid)->descriptor);
@@ -1274,6 +1274,13 @@ int lg4ff_init(struct hid_device *hid)int mmode_ret, mmode_idx =-1 ;u16 real_product_id; +if (list_empty (&hid->inputs)) { +hid_err (hid,"no inputs found\n" ); +return -ENODEV ; + } + hidinput = list_entry(hid->inputs.next, struct hid_input, list); + dev = hidinput->input; +/* Check that the report looks ok */ if (!hid_validate_values (hid,HID_OUTPUT_REPORT ,0 ,0 ,7 ))return -1 ;
drivers/hid/hid-lgff.c +9 -2
@@ -127,12 +127,19 @@ static void hid_lgff_set_autocenter(struct input_dev *dev, u16 magnitude)int lgff_init (struct hid_device * hid) { - struct hid_input *hidinput = list_entry(hid->inputs.next, struct hid_input, list); -struct input_dev *dev = hidinput->input; +struct hid_input *hidinput; +struct input_dev *dev;const signed short *ff_bits = ff_joystick;int error;int i; +if (list_empty (&hid->inputs)) { +hid_err (hid,"no inputs found\n" ); +return -ENODEV ; + } + hidinput = list_entry(hid->inputs.next, struct hid_input, list); + dev = hidinput->input; +/* Check that the report looks ok */ if (!hid_validate_values (hid,HID_OUTPUT_REPORT ,0 ,0 ,7 ))return -ENODEV ;
drivers/hid/hid-logitech-hidpp.c +9 -2
@@ -1238,8 +1238,8 @@ static void hidpp_ff_destroy(struct ff_device *ff)static int hidpp_ff_init (struct hidpp_device *hidpp,u8 feature_index) {struct hid_device *hid = hidpp->hid_dev; - struct hid_input *hidinput = list_entry(hid->inputs.next, struct hid_input, list); -struct input_dev *dev = hidinput->input; +struct hid_input *hidinput; +struct input_dev *dev;const struct usb_device_descriptor *udesc = &(hid_to_usb_dev (hid)->descriptor);const u16 bcdDevice =le16_to_cpu (udesc->bcdDevice);struct ff_device *ff;
@@ -1248,6 +1248,13 @@ static int hidpp_ff_init(struct hidpp_device *hidpp, u8 feature_index)int error, j, num_slots;u8 version; +if (list_empty (&hid->inputs)) { +hid_err (hid,"no inputs found\n" ); +return -ENODEV ; + } + hidinput = list_entry(hid->inputs.next, struct hid_input, list); + dev = hidinput->input; +if (!dev) {hid_err (hid,"Struct input_dev not set!\n" );return -EINVAL ;
drivers/hid/hid-sony.c +9 -3
@@ -2008,9 +2008,15 @@ static int sony_play_effect(struct input_dev *dev, void *data,static int sony_init_ff (struct sony_sc *sc) { -struct hid_input *hidinput =list_entry (sc->hdev->inputs.next, - struct hid_input, list); -struct input_dev *input_dev = hidinput->input; +struct hid_input *hidinput; +struct input_dev *input_dev; + +if (list_empty (&sc->hdev->inputs)) { +hid_err (sc->hdev,"no inputs found\n" ); +return -ENODEV ; + } + hidinput = list_entry(sc->hdev->inputs.next, struct hid_input, list); + input_dev = hidinput->input;input_set_capability (input_dev,EV_FF ,FF_RUMBLE );return input_ff_create_memless (input_dev,NULL , sony_play_effect);
drivers/hid/hid-tmff.c +9 -3
@@ -136,12 +136,18 @@ static int tmff_init(struct hid_device *hid, const signed short *ff_bits)struct tmff_device *tmff;struct hid_report *report;struct list_head *report_list; -struct hid_input *hidinput =list_entry (hid->inputs.next, - struct hid_input, list); -struct input_dev *input_dev = hidinput->input; +struct hid_input *hidinput; +struct input_dev *input_dev;int error;int i; +if (list_empty (&hid->inputs)) { +hid_err (hid,"no inputs found\n" ); +return -ENODEV ; + } + hidinput = list_entry(hid->inputs.next, struct hid_input, list); + input_dev = hidinput->input; + tmff =kzalloc (sizeof (struct tmff_device ),GFP_KERNEL );if (!tmff)return -ENOMEM ;
drivers/hid/hid-zpff.c +9 -3
@@ -66,11 +66,17 @@ static int zpff_init(struct hid_device *hid) {struct zpff_device *zpff;struct hid_report *report; -struct hid_input *hidinput =list_entry (hid->inputs.next, - struct hid_input, list); -struct input_dev *dev = hidinput->input; +struct hid_input *hidinput; +struct input_dev *dev;int i, error; +if (list_empty (&hid->inputs)) { +hid_err (hid,"no inputs found\n" ); +return -ENODEV ; + } + hidinput = list_entry(hid->inputs.next, struct hid_input, list); + dev = hidinput->input; +for (i =0 ; i <4 ; i++) { report =hid_validate_values (hid,HID_OUTPUT_REPORT ,0 , i,1 );if (!report)
drivers/hid/i2c-hid/i2c-hid-dmi-quirks.c +35 -0
@@ -322,6 +322,25 @@ static const struct dmi_system_id i2c_hid_dmi_desc_override_table[] = { }, .driver_data = (void *)&sipodev_desc }, + { +/* +* There are at least 2 Primebook C11B versions, the older +* version has a product-name of "Primebook C11B", and a +* bios version / release / firmware revision of: +* V2.1.2 / 05/03/2018 / 18.2 +* The new version has "PRIMEBOOK C11B" as product-name and a +* bios version / release / firmware revision of: +* CFALKSW05_BIOS_V1.1.2 / 11/19/2018 / 19.2 +* Only the older version needs this quirk, note the newer +* version will not match as it has a different product-name. +*/ + .ident = "Trekstor Primebook C11B", + .matches = { +DMI_EXACT_MATCH (DMI_SYS_VENDOR ,"TREKSTOR" ), + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Primebook C11B"), + }, + .driver_data = (void *)&sipodev_desc + }, { .ident ="Direkt-Tek DTLAPY116-2" , .matches = {
@@ -330,6 +349,14 @@ static const struct dmi_system_id i2c_hid_dmi_desc_override_table[] = { }, .driver_data = (void *)&sipodev_desc }, + { + .ident = "Direkt-Tek DTLAPY133-1", + .matches = { +DMI_EXACT_MATCH (DMI_SYS_VENDOR ,"Direkt-Tek" ), + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "DTLAPY133-1"), + }, + .driver_data = (void *)&sipodev_desc + }, { .ident ="Mediacom Flexbook Edge 11" , .matches = {
@@ -338,6 +365,14 @@ static const struct dmi_system_id i2c_hid_dmi_desc_override_table[] = { }, .driver_data = (void *)&sipodev_desc }, + { + .ident = "Odys Winbook 13", + .matches = { + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "AXDIA International GmbH"), + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "WINBOOK 13"), + }, + .driver_data = (void *)&sipodev_desc + }, { } /* Terminate list */ };
drivers/iio/accel/bmc150-accel-core.c +1 -1
@@ -125,7 +125,7 @@#define BMC150_ACCEL_SLEEP_1_SEC 0x0F#define BMC150_ACCEL_REG_TEMP 0x08 -#define BMC150_ACCEL_TEMP_CENTER_VAL 24 +#define BMC150_ACCEL_TEMP_CENTER_VAL 23#define BMC150_ACCEL_AXIS_TO_REG (axis) (BMC150_ACCEL_REG_XOUT_L + (axis * 2))#define BMC150_AUTO_SUSPEND_DELAY_MS 2000
drivers/infiniband/core/cma.c +2 -1
@@ -2119,9 +2119,10 @@ static int iw_conn_req_handler(struct iw_cm_id *cm_id, conn_id->cm_id.iw =NULL ;cma_exch (conn_id,RDMA_CM_DESTROYING );mutex_unlock (&conn_id->handler_mutex); +mutex_unlock (&listen_id->handler_mutex);cma_deref_id (conn_id);rdma_destroy_id (&conn_id->id); - goto out; +return ret; }mutex_unlock (&conn_id->handler_mutex);
drivers/md/dm-bio-prison.c +1 -1
@@ -32,7 +32,7 @@ static struct kmem_cache *_cell_cache;*/ struct dm_bio_prison *dm_bio_prison_create (void ) { -struct dm_bio_prison *prison =kmalloc (sizeof (*prison),GFP_KERNEL ); +struct dm_bio_prison *prison =kzalloc (sizeof (*prison),GFP_KERNEL );if (!prison)return NULL ;
drivers/md/dm-io.c +1 -1
@@ -50,7 +50,7 @@ struct dm_io_client *dm_io_client_create(void)struct dm_io_client *client;unsigned min_ios =dm_get_reserved_bio_based_ios (); - client =kmalloc (sizeof (*client),GFP_KERNEL ); + client =kzalloc (sizeof (*client),GFP_KERNEL );if (!client)return ERR_PTR (-ENOMEM );
drivers/md/dm-kcopyd.c +1 -1
@@ -828,7 +828,7 @@ struct dm_kcopyd_client *dm_kcopyd_client_create(struct dm_kcopyd_throttle *throint r = -ENOMEM ;struct dm_kcopyd_client *kc; - kc =kmalloc (sizeof (*kc),GFP_KERNEL ); + kc =kzalloc (sizeof (*kc),GFP_KERNEL );if (!kc)return ERR_PTR (-ENOMEM );
drivers/md/dm-region-hash.c +1 -1
@@ -179,7 +179,7 @@ struct dm_region_hash *dm_region_hash_create( ; nr_buckets >>=1 ; - rh =kmalloc (sizeof (*rh),GFP_KERNEL ); + rh =kzalloc (sizeof (*rh),GFP_KERNEL );if (!rh) {DMERR ("unable to allocate region hash memory" );return ERR_PTR (-ENOMEM );
drivers/md/dm-snap.c +119 -59
458 lines not on this page · raw message
drivers/md/dm-thin.c +1 -1
@@ -2965,7 +2965,7 @@ static struct pool *pool_create(struct mapped_device *pool_md,return (struct pool *)pmd; } - pool =kmalloc (sizeof (*pool),GFP_KERNEL ); + pool =kzalloc (sizeof (*pool),GFP_KERNEL );if (!pool) { *error ="Error allocating memory for pool" ; err_p =ERR_PTR (-ENOMEM );
drivers/net/bonding/bond_main.c +1 -1
@@ -3963,7 +3963,7 @@ int bond_update_slave_arr(struct bonding *bond, struct slave *skipslave)* this to-be-skipped slave to send a packet out. */ old_arr =rtnl_dereference (bond->slave_arr); -for (idx =0 ; idx < old_arr->count; idx++) { +for (idx =0 ; old_arr !=NULL && idx < old_arr->count; idx++) {if (skipslave == old_arr->arr[idx]) { old_arr->arr[idx] = old_arr->arr[old_arr->count-1 ];
drivers/net/usb/sr9800.c +1 -1
@@ -336,7 +336,7 @@ static void sr_set_multicast(struct net_device *net)static int sr_mdio_read (struct net_device *net,int phy_id,int loc) {struct usbnet *dev =netdev_priv (net); -__le16 res; +__le16 res =0 ;mutex_lock (&dev->phy_mutex);sr_set_sw_mii (dev);
drivers/net/wireless/ath/ath6kl/usb.c +8 -0
@@ -132,6 +132,10 @@ ath6kl_usb_alloc_urb_from_pipe(struct ath6kl_usb_pipe *pipe)struct ath6kl_urb_context *urb_context =NULL ;unsigned long flags; +/* bail if this pipe is not initialized */ +if (!pipe->ar_usb) +return NULL ; +spin_lock_irqsave (&pipe->ar_usb->cs_lock, flags);if (!list_empty (&pipe->urb_list_head)) { urb_context =
@@ -150,6 +154,10 @@ static void ath6kl_usb_free_urb_to_pipe(struct ath6kl_usb_pipe *pipe, {unsigned long flags; +/* bail if this pipe is not initialized */ +if (!pipe->ar_usb) +return ; +spin_lock_irqsave (&pipe->ar_usb->cs_lock, flags); pipe->urb_cnt++;
drivers/net/wireless/realtek/rtlwifi/ps.c +6 -0
@@ -770,6 +770,9 @@ static void rtl_p2p_noa_ie(struct ieee80211_hw *hw, void *data,return ; }else { noa_num = (noa_len -2 ) /13 ; +if (noa_num >P2P_MAX_NOA_NUM ) + noa_num =P2P_MAX_NOA_NUM ; + } noa_index = ie[3 ]; if (rtlpriv->psc.p2p_ps_info.p2p_ps_mode ==
@@ -864,6 +867,9 @@ static void rtl_p2p_action_ie(struct ieee80211_hw *hw, void *data,return ; }else { noa_num = (noa_len -2 ) /13 ; +if (noa_num >P2P_MAX_NOA_NUM ) + noa_num =P2P_MAX_NOA_NUM ; + } noa_index = ie[3 ]; if (rtlpriv->psc.p2p_ps_info.p2p_ps_mode ==
drivers/rtc/rtc-pcf8523.c +20 -8
@@ -94,8 +94,9 @@ static int pcf8523_voltage_low(struct i2c_client *client)return !!(value ®_CONTROL3_BLF ); } -static int pcf8523_select_capacitance (struct i2c_client *client,bool high) +static int pcf8523_load_capacitance (struct i2c_client *client) { +u32 load;u8 value;int err;
@@ -103,14 +104,24 @@ static int pcf8523_select_capacitance(struct i2c_client *client, bool high)if (err <0 )return err; -if (!high) - value &= ~REG_CONTROL1_CAP_SEL ; -else + load =12500 ; +of_property_read_u32 (client->dev.of_node,"quartz-load-femtofarads" , + &load); + +switch (load) { +default : +dev_warn (&client->dev,"Unknown quartz-load-femtofarads value: %d. Assuming 12500" , + load); +/* fall through */ +case 12500 : value |=REG_CONTROL1_CAP_SEL ; +break ; +case 7000 : + value &= ~REG_CONTROL1_CAP_SEL ; +break ; + } err =pcf8523_write (client,REG_CONTROL1 , value); -if (err <0 ) -return err;return err; }
@@ -307,9 +318,10 @@ static int pcf8523_probe(struct i2c_client *client,if (!pcf)return -ENOMEM ; - err =pcf8523_select_capacitance (client, true); + err =pcf8523_load_capacitance (client);if (err <0 ) -return err; +dev_warn (&client->dev,"failed to set xtal load capacitance: %d" , + err); err =pcf8523_set_pm (client,0 );if (err <0 )
drivers/staging/rtl8188eu/os_dep/usb_intf.c +4 -2
@@ -366,8 +366,10 @@ static struct adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj, } padapter->HalData =kzalloc (sizeof (struct hal_data_8188e ),GFP_KERNEL ); -if (!padapter->HalData) -DBG_88E ("cant not alloc memory for HAL DATA\n" ); +if (!padapter->HalData) { +DBG_88E ("Failed to allocate memory for HAL data\n" ); + goto free_adapter; + } padapter->intf_start = &usb_intf_start; padapter->intf_stop = &usb_intf_stop;
drivers/thunderbolt/nhi.c +18 -4
@@ -95,9 +95,20 @@ static void __iomem *ring_options_base(struct tb_ring *ring)return io; } -static void ring_iowrite16desc (struct tb_ring *ring,u32 value,u32 offset) +static void ring_iowrite_cons (struct tb_ring *ring,u16 cons) { -iowrite16 (value,ring_desc_base (ring) + offset); +/* +* The other 16-bits in the register is read-only and writes to it +* are ignored by the hardware so we can save one ioread32() by +* filling the read-only bits with zeroes. +*/ +iowrite32 (cons,ring_desc_base (ring) +8 ); +} + +static void ring_iowrite_prod (struct tb_ring *ring,u16 prod) +{ +/* See ring_iowrite_cons() above for explanation */ +iowrite32 (prod <<16 ,ring_desc_base (ring) +8 ); }static void ring_iowrite32desc (struct tb_ring *ring,u32 value,u32 offset)
@@ -149,7 +160,10 @@ static void ring_write_descriptors(struct tb_ring *ring) descriptor->sof = frame->sof; } ring->head = (ring->head +1 ) % ring->size; -ring_iowrite16desc (ring, ring->head, ring->is_tx ?10 :8 ); +if (ring->is_tx) +ring_iowrite_prod (ring, ring->head); +else +ring_iowrite_cons (ring, ring->head); } }
@@ -369,7 +383,7 @@ void ring_stop(struct tb_ring *ring)ring_iowrite32options (ring,0 ,0 );ring_iowrite64desc (ring,0 ,0 ); -ring_iowrite16desc (ring,0 , ring->is_tx ?10 :8 ); +ring_iowrite32desc (ring,0 ,8 );ring_iowrite32desc (ring,0 ,12 ); ring->head =0 ; ring->tail =0 ;
drivers/tty/serial/sc16is7xx.c +28 -0
@@ -332,6 +332,7 @@ struct sc16is7xx_port {struct kthread_worker kworker;struct task_struct *kworker_task;struct kthread_work irq_work; +struct mutex efr_lock;struct sc16is7xx_one p[0 ]; };
@@ -503,6 +504,21 @@ static int sc16is7xx_set_baud(struct uart_port *port, int baud) div /=4 ; } +/* In an amazing feat of design, the Enhanced Features Register shares +* the address of the Interrupt Identification Register, and is +* switched in by writing a magic value (0xbf) to the Line Control +* Register. Any interrupt firing during this time will see the EFR +* where it expects the IIR to be, leading to "Unexpected interrupt" +* messages. +* +* Prevent this possibility by claiming a mutex while accessing the +* EFR, and claiming the same mutex from within the interrupt handler. +* This is similar to disabling the interrupt, but that doesn't work +* because the bulk of the interrupt processing is run as a workqueue +* job in thread context. +*/ +mutex_lock (&s->efr_lock); + lcr =sc16is7xx_port_read (port,SC16IS7XX_LCR_REG );/* Open the LCR divisors for configuration */
@@ -518,6 +534,8 @@ static int sc16is7xx_set_baud(struct uart_port *port, int baud)/* Put LCR back to the normal mode */ sc16is7xx_port_write (port,SC16IS7XX_LCR_REG , lcr); +mutex_unlock (&s->efr_lock); +sc16is7xx_port_update (port,SC16IS7XX_MCR_REG ,SC16IS7XX_MCR_CLKSEL_BIT , prescaler);
@@ -700,6 +718,8 @@ static void sc16is7xx_ist(struct kthread_work *ws) {struct sc16is7xx_port *s =to_sc16is7xx_port (ws, irq_work); +mutex_lock (&s->efr_lock); +while (1 ) {bool keep_polling = false;int i;
@@ -709,6 +729,8 @@ static void sc16is7xx_ist(struct kthread_work *ws)if (!keep_polling)break ; } + +mutex_unlock (&s->efr_lock); }static irqreturn_t sc16is7xx_irq (int irq,void *dev_id)
@@ -903,6 +925,9 @@ static void sc16is7xx_set_termios(struct uart_port *port,if (!(termios->c_cflag &CREAD )) port->ignore_status_mask |=SC16IS7XX_LSR_BRK_ERROR_MASK ; +/* As above, claim the mutex while accessing the EFR. */ +mutex_lock (&s->efr_lock); +sc16is7xx_port_write (port,SC16IS7XX_LCR_REG ,SC16IS7XX_LCR_CONF_MODE_B );
@@ -924,6 +949,8 @@ static void sc16is7xx_set_termios(struct uart_port *port,/* Update LCR register */ sc16is7xx_port_write (port,SC16IS7XX_LCR_REG , lcr); +mutex_unlock (&s->efr_lock); +/* Get baud rate generator configuration */ baud = uart_get_baud_rate(port, termios, old, port->uartclk / 16 / 4 / 0xffff,
@@ -1186,6 +1213,7 @@ static int sc16is7xx_probe(struct device *dev, s->regmap = regmap; s->devtype = devtype;dev_set_drvdata (dev, s); +mutex_init (&s->efr_lock);kthread_init_worker (&s->kworker);kthread_init_work (&s->irq_work, sc16is7xx_ist);
drivers/tty/serial/serial_mctrl_gpio.c +3 -0
@@ -68,6 +68,9 @@ EXPORT_SYMBOL_GPL(mctrl_gpio_set);struct gpio_desc *mctrl_gpio_to_gpiod (struct mctrl_gpios *gpios,enum mctrl_gpio_idx gidx) { +if (gpios ==NULL ) +return NULL ; +return gpios->gpio[gidx]; }EXPORT_SYMBOL_GPL (mctrl_gpio_to_gpiod);
drivers/usb/core/hub.c +7 -0
@@ -102,6 +102,8 @@ EXPORT_SYMBOL_GPL(ehci_cf_port_reset_rwsem);static void hub_release (struct kref *kref);static int usb_reset_and_verify_device (struct usb_device *udev);static int hub_port_disable (struct usb_hub *hub,int port1,int set_state); +static bool hub_port_warm_reset_required (struct usb_hub *hub,int port1, +u16 portstatus);static inline char *portspeed (struct usb_hub *hub,int portstatus) {
@@ -1108,6 +1110,11 @@ static void hub_activate(struct usb_hub *hub, enum hub_activation_type type) USB_PORT_FEAT_ENABLE); } +/* Make sure a warm-reset request is handled by port_event */ +if (type ==HUB_RESUME && +hub_port_warm_reset_required (hub, port1, portstatus)) +set_bit (port1, hub->event_bits); +/* * Add debounce if USB3 link is in polling/link training state. * Link will automatically transition to Enabled state after
drivers/usb/gadget/udc/core.c +11 -0
@@ -106,6 +106,17 @@ int usb_ep_enable(struct usb_ep *ep)if (ep->enabled) goto out; +/* UDC drivers can't handle endpoints with maxpacket size 0 */ +if (usb_endpoint_maxp (ep->desc) ==0 ) { +/* +* We should log an error message here, but we can't call +* dev_err() because there's no way to find the gadget +* given only ep. +*/ + ret = -EINVAL ; + goto out; + } + ret = ep->ops->enable (ep, ep->desc);if (ret) goto out;
drivers/usb/misc/ldusb.c +3 -3
@@ -499,11 +499,11 @@ static ssize_t ld_usb_read(struct file *file, char __user *buffer, size_t count, retval = -EFAULT ; goto unlock_exit; } - dev->ring_tail = (dev->ring_tail+1 ) % ring_buffer_size; - retval = bytes_to_read;spin_lock_irq (&dev->rbsl); + dev->ring_tail = (dev->ring_tail +1 ) % ring_buffer_size; +if (dev->buffer_overflow) { dev->buffer_overflow =0 ;spin_unlock_irq (&dev->rbsl);
@@ -584,7 +584,7 @@ static ssize_t ld_usb_write(struct file *file, const char __user *buffer,1 <<8 ,0 , dev->interrupt_out_buffer, bytes_to_write, - USB_CTRL_SET_TIMEOUT * HZ); + USB_CTRL_SET_TIMEOUT);if (retval <0 ) dev_err(&dev->intf->dev, "Couldn't submit HID_REQ_SET_REPORT %d\n",
drivers/usb/misc/legousbtower.c +1 -1
@@ -898,7 +898,7 @@ static int tower_probe (struct usb_interface *interface, const struct usb_device get_version_reply,sizeof (*get_version_reply), 1000); -if (result <sizeof (*get_version_reply)) { +if (result !=sizeof (*get_version_reply)) {if (result >=0 ) result = -EIO ;dev_err (idev,"get version request failed: %d\n" , result);
drivers/usb/serial/whiteheat.c +10 -3
@@ -604,6 +604,10 @@ static int firm_send_command(struct usb_serial_port *port, __u8 command, command_port = port->serial->port[COMMAND_PORT ]; command_info =usb_get_serial_port_data (command_port); + +if (command_port->bulk_out_size < datasize +1 ) +return -EIO ; +mutex_lock (&command_info->mutex); command_info->command_finished = false;
@@ -677,6 +681,7 @@ static void firm_setup_port(struct tty_struct *tty)struct device *dev = &port->dev;struct whiteheat_port_settings port_settings;unsigned int cflag = tty->termios.c_cflag; +speed_t baud; port_settings.port = port->port_number +1 ;
@@ -737,11 +742,13 @@ static void firm_setup_port(struct tty_struct *tty)dev_dbg (dev,"%s - XON = %2x, XOFF = %2x\n" , __func__, port_settings.xon, port_settings.xoff);/* get the baud rate wanted */ - port_settings.baud =tty_get_baud_rate (tty); -dev_dbg (dev,"%s - baud rate = %d\n" , __func__, port_settings.baud); + baud =tty_get_baud_rate (tty); + port_settings.baud =cpu_to_le32 (baud); +dev_dbg (dev,"%s - baud rate = %u\n" , __func__, baud);/* fixme: should set validated settings */ -tty_encode_baud_rate (tty, port_settings.baud, port_settings.baud); +tty_encode_baud_rate (tty, baud, baud); +/* handle any settings that aren't specified in the tty structure */ port_settings.lloop =0 ;
drivers/usb/serial/whiteheat.h +1 -1
@@ -91,7 +91,7 @@ struct whiteheat_simple {struct whiteheat_port_settings {__u8 port;/* port number (1 to N) */ -__u32 baud;/* any value 7 - 460800, firmware calculates +__le32 baud;/* any value 7 - 460800, firmware calculates best fit; arrives little endian */ __u8 bits;/* 5, 6, 7, or 8 */ __u8 stop;/* 1 or 2, default 1 (2 = 1.5 if bits = 5) */
drivers/usb/storage/scsiglue.c +0 -10
@@ -81,7 +81,6 @@ static const char* host_info(struct Scsi_Host *host)static int slave_alloc (struct scsi_device *sdev) {struct us_data *us =host_to_us (sdev->host); -int maxp;/* * Set the INQUIRY transfer length to 36. We don't use any of
@@ -90,15 +89,6 @@ static int slave_alloc (struct scsi_device *sdev)*/ sdev->inquiry_len =36 ; -/* -* USB has unusual scatter-gather requirements: the length of each -* scatterlist element except the last must be divisible by the -* Bulk maxpacket value. Fortunately this value is always a -* power of 2. Inform the block layer about this requirement. -*/ - maxp =usb_maxpacket (us->pusb_dev, us->recv_bulk_pipe,0 ); -blk_queue_virt_boundary (sdev->request_queue, maxp -1 ); -/* * Some host controllers may have alignment requirements. * We'll play it safe by requiring 512-byte alignment always.
drivers/usb/storage/uas.c +0 -20
@@ -796,29 +796,9 @@ static int uas_slave_alloc(struct scsi_device *sdev) {struct uas_dev_info *devinfo = (struct uas_dev_info *)sdev->host->hostdata; -int maxp; sdev->hostdata = devinfo; -/* -* We have two requirements here. We must satisfy the requirements -* of the physical HC and the demands of the protocol, as we -* definitely want no additional memory allocation in this path -* ruling out using bounce buffers. -* -* For a transmission on USB to continue we must never send -* a package that is smaller than maxpacket. Hence the length of each -* scatterlist element except the last must be divisible by the -* Bulk maxpacket value. -* If the HC does not ensure that through SG, -* the upper layer must do that. We must assume nothing -* about the capabilities off the HC, so we use the most -* pessimistic requirement. -*/ - - maxp =usb_maxpacket (devinfo->udev, devinfo->data_in_pipe,0 ); -blk_queue_virt_boundary (sdev->request_queue, maxp -1 ); -/* * The protocol has no requirements on alignment in the strict sense. * Controllers may or may not have alignment restrictions.
fs/binfmt_script.c +48 -9
80 lines not on this page · raw message
fs/cifs/netmisc.c +0 -4
@@ -130,10 +130,6 @@ static const struct smb_to_posix_error mapping_table_ERRSRV[] = { {0, 0} }; -static const struct smb_to_posix_error mapping_table_ERRHRD[] = { - {0 ,0 } -}; -/* * Convert a string containing text IPv4 or IPv6 address to binary form. *
fs/fuse/dir.c +13 -0
@@ -1654,6 +1654,19 @@ int fuse_do_setattr(struct dentry *dentry, struct iattr *attr,if (attr->ia_valid &ATTR_SIZE ) is_truncate = true; +/* Flush dirty data/metadata before non-truncate SETATTR */ +if (is_wb &&S_ISREG (inode->i_mode) && + attr->ia_valid & + (ATTR_MODE |ATTR_UID |ATTR_GID |ATTR_MTIME_SET | +ATTR_TIMES_SET )) { + err =write_inode_now (inode, true); +if (err) +return err; + +fuse_set_nowrite (inode); +fuse_release_nowrite (inode); + } +if (is_truncate) {fuse_set_nowrite (inode);set_bit (FUSE_I_SIZE_UNSTABLE , &fi->state);
fs/fuse/file.c +7 -3
@@ -201,7 +201,7 @@ int fuse_open_common(struct inode *inode, struct file *file, bool isdir) {struct fuse_conn *fc =get_fuse_conn (inode);int err; -bool lock_inode = (file->f_flags &O_TRUNC ) && +bool is_wb_truncate = (file->f_flags &O_TRUNC ) && fc->atomic_o_trunc && fc->writeback_cache;
@@ -209,16 +209,20 @@ int fuse_open_common(struct inode *inode, struct file *file, bool isdir)if (err)return err; -if (lock_inode) +if (is_wb_truncate) {inode_lock (inode); +fuse_set_nowrite (inode); + } err =fuse_do_open (fc,get_node_id (inode), file, isdir);if (!err)fuse_finish_open (inode, file); -if (lock_inode) +if (is_wb_truncate) { +fuse_release_nowrite (inode);inode_unlock (inode); + }return err; }
fs/nfs/nfs4proc.c +1 -0
@@ -5544,6 +5544,7 @@ int nfs4_proc_setclientid(struct nfs_client *clp, u32 program, } status = task->tk_status;if (setclientid.sc_cred) { +kfree (clp->cl_acceptor); clp->cl_acceptor =rpcauth_stringify_acceptor (setclientid.sc_cred);put_rpccred (setclientid.sc_cred); }
fs/ocfs2/aops.c +23 -2
@@ -2046,7 +2046,8 @@ int ocfs2_write_end_nolock(struct address_space *mapping, inode->i_mtime = inode->i_ctime =current_time (inode); di->i_mtime = di->i_ctime =cpu_to_le64 (inode->i_mtime.tv_sec); di->i_mtime_nsec = di->i_ctime_nsec =cpu_to_le32 (inode->i_mtime.tv_nsec); -ocfs2_update_inode_fsync_trans (handle, inode,1 ); +if (handle) +ocfs2_update_inode_fsync_trans (handle, inode,1 ); }if (handle)ocfs2_journal_dirty (handle, wc->w_di_bh);
@@ -2143,13 +2144,30 @@ static int ocfs2_dio_wr_get_block(struct inode *inode, sector_t iblock,struct ocfs2_dio_write_ctxt *dwc =NULL ;struct buffer_head *di_bh =NULL ;u64 p_blkno; -loff_t pos = iblock << inode->i_sb->s_blocksize_bits; +unsigned int i_blkbits = inode->i_sb->s_blocksize_bits; +loff_t pos = iblock << i_blkbits; +sector_t endblk = (i_size_read (inode) -1 ) >> i_blkbits;unsigned len, total_len = bh_result->b_size;int ret =0 , first_get_block =0 ; len = osb->s_clustersize - (pos & (osb->s_clustersize -1 )); len =min (total_len, len); +/* +* bh_result->b_size is count in get_more_blocks according to write +* "pos" and "end", we need map twice to return different buffer state: +* 1. area in file size, not set NEW; +* 2. area out file size, set NEW. +* +* iblock endblk +* |--------|---------|---------|--------- +* |<-------area in file------->| +*/ + +if ((iblock <= endblk) && + ((iblock + ((len -1 ) >> i_blkbits)) > endblk)) + len = (endblk - iblock +1 ) << i_blkbits; +mlog (0 ,"get block of %lu at %llu:%u req %u\n" , inode->i_ino, pos, len, total_len);
@@ -2233,6 +2251,9 @@ static int ocfs2_dio_wr_get_block(struct inode *inode, sector_t iblock,if (desc->c_needs_zero)set_buffer_new (bh_result); +if (iblock > endblk) +set_buffer_new (bh_result); +/* May sleep in end_io. It should not happen in a irq context. So defer * it to dio work queue. */ set_buffer_defer_completion (bh_result);
fs/ocfs2/ioctl.c +1 -1
@@ -289,7 +289,7 @@ static int ocfs2_info_scan_inode_alloc(struct ocfs2_super *osb,if (inode_alloc)inode_lock (inode_alloc); -if (o2info_coherent (&fi->ifi_req)) { +if (inode_alloc &&o2info_coherent (&fi->ifi_req)) { status =ocfs2_inode_lock (inode_alloc, &bh,0 );if (status <0 ) {mlog_errno (status);
fs/ocfs2/xattr.c +23 -33
70 lines not on this page · raw message
fs/xfs/xfs_buf.c +1 -1
@@ -1674,7 +1674,7 @@ xfs_buftarg_isolate(* zero. If the value is already zero, we need to reclaim the * buffer, otherwise it gets another trip through the LRU. */ -if (!atomic_add_unless (&bp->b_lru_ref,-1 ,0 )) { +if (atomic_add_unless (&bp->b_lru_ref,-1 ,0 )) {spin_unlock (&bp->b_lock);return LRU_ROTATE ; }
include/net/llc_conn.h +1 -1
@@ -104,7 +104,7 @@ void llc_sk_reset(struct sock *sk);/* Access to a connection */ int llc_conn_state_process (struct sock *sk,struct sk_buff *skb); -int llc_conn_send_pdu (struct sock *sk,struct sk_buff *skb); +void llc_conn_send_pdu (struct sock *sk,struct sk_buff *skb);void llc_conn_rtn_pdu (struct sock *sk,struct sk_buff *skb);void llc_conn_resend_i_pdu_as_cmd (struct sock *sk,u8 nr,u8 first_p_bit);void llc_conn_resend_i_pdu_as_rsp (struct sock *sk,u8 nr,u8 first_f_bit);
include/net/sch_generic.h +5 -0
@@ -276,6 +276,11 @@ static inline struct Qdisc *qdisc_root(const struct Qdisc *qdisc)return q; } +static inline struct Qdisc *qdisc_root_bh (const struct Qdisc *qdisc) +{ +return rcu_dereference_bh (qdisc->dev_queue->qdisc); +} +static inline struct Qdisc *qdisc_root_sleeping (const struct Qdisc *qdisc) {return qdisc->dev_queue->qdisc_sleeping;
include/net/sctp/sctp.h +2 -0
@@ -103,6 +103,8 @@ void sctp_addr_wq_mgmt(struct net *, struct sctp_sockaddr_entry *, int);/* * sctp/socket.c */ +int sctp_inet_connect (struct socket *sock,struct sockaddr *uaddr, +int addr_len,int flags);int sctp_backlog_rcv (struct sock *sk,struct sk_buff *skb);int sctp_inet_listen (struct socket *sock,int backlog);void sctp_write_space (struct sock *sk);
include/sound/timer.h +2 -0
@@ -90,6 +90,8 @@ struct snd_timer {struct list_head ack_list_head;struct list_head sack_list_head;/* slow ack list head */ struct tasklet_struct task_queue; +int max_instances;/* upper limit of timer instances */ +int num_instances;/* current number of timer instances */ };struct snd_timer_instance {
kernel/trace/trace.c +1 -0
@@ -5217,6 +5217,7 @@ tracing_read_pipe(struct file *filp, char __user *ubuf,sizeof (struct trace_iterator ) - offsetof(struct trace_iterator, seq));cpumask_clear (iter->started); +trace_seq_init (&iter->seq); iter->pos =-1 ;trace_event_read_lock ();
net/llc/llc_c_ac.c +6 -2
@@ -372,6 +372,7 @@ int llc_conn_ac_send_i_cmd_p_set_1(struct sock *sk, struct sk_buff *skb)llc_pdu_init_as_i_cmd (skb,1 , llc->vS, llc->vR); rc =llc_mac_hdr_init (skb, llc->dev->dev_addr, llc->daddr.mac);if (likely (!rc)) { +skb_get (skb);llc_conn_send_pdu (sk, skb);llc_conn_ac_inc_vs_by_1 (sk, skb); }
@@ -389,7 +390,8 @@ static int llc_conn_ac_send_i_cmd_p_set_0(struct sock *sk, struct sk_buff *skb)llc_pdu_init_as_i_cmd (skb,0 , llc->vS, llc->vR); rc =llc_mac_hdr_init (skb, llc->dev->dev_addr, llc->daddr.mac);if (likely (!rc)) { - rc =llc_conn_send_pdu (sk, skb); +skb_get (skb); +llc_conn_send_pdu (sk, skb);llc_conn_ac_inc_vs_by_1 (sk, skb); }return rc;
@@ -406,6 +408,7 @@ int llc_conn_ac_send_i_xxx_x_set_0(struct sock *sk, struct sk_buff *skb)llc_pdu_init_as_i_cmd (skb,0 , llc->vS, llc->vR); rc =llc_mac_hdr_init (skb, llc->dev->dev_addr, llc->daddr.mac);if (likely (!rc)) { +skb_get (skb);llc_conn_send_pdu (sk, skb);llc_conn_ac_inc_vs_by_1 (sk, skb); }
@@ -916,7 +919,8 @@ static int llc_conn_ac_send_i_rsp_f_set_ackpf(struct sock *sk,llc_pdu_init_as_i_cmd (skb, llc->ack_pf, llc->vS, llc->vR); rc =llc_mac_hdr_init (skb, llc->dev->dev_addr, llc->daddr.mac);if (likely (!rc)) { - rc =llc_conn_send_pdu (sk, skb); +skb_get (skb); +llc_conn_send_pdu (sk, skb);llc_conn_ac_inc_vs_by_1 (sk, skb); }return rc;
net/llc/llc_conn.c +9 -23
@@ -30,7 +30,7 @@#endif static int llc_find_offset (int state,int ev_type); -static int llc_conn_send_pdus (struct sock *sk,struct sk_buff *skb); +static void llc_conn_send_pdus (struct sock *sk);static int llc_conn_service (struct sock *sk,struct sk_buff *skb); static int llc_exec_conn_trans_actions(struct sock *sk, struct llc_conn_state_trans *trans,
@@ -193,11 +193,11 @@ int llc_conn_state_process(struct sock *sk, struct sk_buff *skb)return rc; } -int llc_conn_send_pdu (struct sock *sk,struct sk_buff *skb) +void llc_conn_send_pdu (struct sock *sk,struct sk_buff *skb) {/* queue PDU to send to MAC layer */ skb_queue_tail (&sk->sk_write_queue, skb); -return llc_conn_send_pdus (sk, skb); +llc_conn_send_pdus (sk); }/**
@@ -255,7 +255,7 @@ void llc_conn_resend_i_pdu_as_cmd(struct sock *sk, u8 nr, u8 first_p_bit)if (howmany_resend >0 ) llc->vS = (llc->vS +1 ) %LLC_2_SEQ_NBR_MODULO ;/* any PDUs to re-send are queued up; start sending to MAC */ -llc_conn_send_pdus (sk,NULL ); +llc_conn_send_pdus (sk); out:; }
@@ -296,7 +296,7 @@ void llc_conn_resend_i_pdu_as_rsp(struct sock *sk, u8 nr, u8 first_f_bit)if (howmany_resend >0 ) llc->vS = (llc->vS +1 ) %LLC_2_SEQ_NBR_MODULO ;/* any PDUs to re-send are queued up; start sending to MAC */ -llc_conn_send_pdus (sk,NULL ); +llc_conn_send_pdus (sk); out:; }
@@ -340,16 +340,12 @@ int llc_conn_remove_acked_pdus(struct sock *sk, u8 nr, u16 *how_many_unacked)/** * llc_conn_send_pdus - Sends queued PDUs * @sk: active connection -* @hold_skb: the skb held by caller, or NULL if does not care * -* Sends queued pdus to MAC layer for transmission. When @hold_skb is -* NULL, always return 0. Otherwise, return 0 if @hold_skb is sent -* successfully, or 1 for failure. +* Sends queued pdus to MAC layer for transmission. */ -static int llc_conn_send_pdus (struct sock *sk,struct sk_buff *hold_skb) +static void llc_conn_send_pdus (struct sock *sk) {struct sk_buff *skb; -int ret =0 ;while ((skb =skb_dequeue (&sk->sk_write_queue)) !=NULL ) {struct llc_pdu_sn *pdu =llc_pdu_sn_hdr (skb);
@@ -361,20 +357,10 @@ static int llc_conn_send_pdus(struct sock *sk, struct sk_buff *hold_skb)skb_queue_tail (&llc_sk (sk)->pdu_unack_q, skb);if (!skb2)break ; -dev_queue_xmit (skb2); - }else { -bool is_target = skb == hold_skb; -int rc; - -if (is_target) -skb_get (skb); - rc =dev_queue_xmit (skb); -if (is_target) - ret = rc; + skb = skb2; } +dev_queue_xmit (skb); } - -return ret; }/**
net/llc/llc_s_ac.c +9 -3
@@ -58,8 +58,10 @@ int llc_sap_action_send_ui(struct llc_sap *sap, struct sk_buff *skb) ev->daddr.lsap, LLC_PDU_CMD);llc_pdu_init_as_ui_cmd (skb); rc =llc_mac_hdr_init (skb, ev->saddr.mac, ev->daddr.mac); -if (likely (!rc)) +if (likely (!rc)) { +skb_get (skb); rc =dev_queue_xmit (skb); + }return rc; }
@@ -81,8 +83,10 @@ int llc_sap_action_send_xid_c(struct llc_sap *sap, struct sk_buff *skb) ev->daddr.lsap, LLC_PDU_CMD);llc_pdu_init_as_xid_cmd (skb,LLC_XID_NULL_CLASS_2 ,0 ); rc =llc_mac_hdr_init (skb, ev->saddr.mac, ev->daddr.mac); -if (likely (!rc)) +if (likely (!rc)) { +skb_get (skb); rc =dev_queue_xmit (skb); + }return rc; }
@@ -135,8 +139,10 @@ int llc_sap_action_send_test_c(struct llc_sap *sap, struct sk_buff *skb) ev->daddr.lsap, LLC_PDU_CMD);llc_pdu_init_as_test_cmd (skb); rc =llc_mac_hdr_init (skb, ev->saddr.mac, ev->daddr.mac); -if (likely (!rc)) +if (likely (!rc)) { +skb_get (skb); rc =dev_queue_xmit (skb); + }return rc; }
net/llc/llc_sap.c +8 -15
@@ -197,29 +197,22 @@ static int llc_sap_next_state(struct llc_sap *sap, struct sk_buff *skb)* After executing actions of the event, upper layer will be indicated * if needed(on receiving an UI frame). sk can be null for the * datalink_proto case. +* +* This function always consumes a reference to the skb. */ static void llc_sap_state_process (struct llc_sap *sap,struct sk_buff *skb) {struct llc_sap_state_ev *ev =llc_sap_ev (skb); -/* -* We have to hold the skb, because llc_sap_next_state -* will kfree it in the sending path and we need to -* look at the skb->cb, where we encode llc_sap_state_ev. -*/ -skb_get (skb); ev->ind_cfm_flag =0 ;llc_sap_next_state (sap, skb); -if (ev->ind_cfm_flag ==LLC_IND ) { -if (skb->sk->sk_state ==TCP_LISTEN ) -kfree_skb (skb); -else { -llc_save_primitive (skb->sk, skb, ev->prim); -/* queue skb to the user. */ -if (sock_queue_rcv_skb (skb->sk, skb)) -kfree_skb (skb); - } +if (ev->ind_cfm_flag ==LLC_IND && skb->sk->sk_state !=TCP_LISTEN ) { +llc_save_primitive (skb->sk, skb, ev->prim); + +/* queue skb to the user. */ +if (sock_queue_rcv_skb (skb->sk, skb) ==0 ) +return ; }kfree_skb (skb); }
net/sched/sch_netem.c +1 -1
@@ -475,7 +475,7 @@ static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch,* skb will be queued. */ if (count >1 && (skb2 =skb_clone (skb,GFP_ATOMIC )) !=NULL ) { -struct Qdisc *rootq =qdisc_root (sch); +struct Qdisc *rootq =qdisc_root_bh (sch);u32 dupsave = q->duplicate;/* prevent duplicating a dup... */ q->duplicate =0 ;
net/sctp/ipv6.c +1 -1
@@ -973,7 +973,7 @@ static const struct proto_ops inet6_seqpacket_ops = { .owner = THIS_MODULE, .release = inet6_release, .bind = inet6_bind, - .connect = inet_dgram_connect, + .connect = sctp_inet_connect, .socketpair = sock_no_socketpair, .accept = inet_accept, .getname = sctp_getname,
net/sctp/protocol.c +1 -1
@@ -1014,7 +1014,7 @@ static const struct proto_ops inet_seqpacket_ops = { .owner = THIS_MODULE, .release = inet_release, /* Needs to be wrapped... */ .bind = inet_bind, - .connect = inet_dgram_connect, + .connect = sctp_inet_connect, .socketpair = sock_no_socketpair, .accept = inet_accept, .getname = inet_getname, /* Semantics are different. */
net/sctp/socket.c +29 -26
119 lines not on this page · raw message
net/wireless/nl80211.c +2 -1
@@ -295,7 +295,8 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { [NL80211_ATTR_MNTR_FLAGS] = { /* NLA_NESTED can't be empty */ }, [NL80211_ATTR_MESH_ID] = { .type = NLA_BINARY, .len = IEEE80211_MAX_MESH_ID_LEN }, - [NL80211_ATTR_MPATH_NEXT_HOP] = { .type = NLA_U32 }, + [NL80211_ATTR_MPATH_NEXT_HOP] = { .type = NLA_BINARY, + .len = ETH_ALEN }, [NL80211_ATTR_REG_ALPHA2] = { .type = NLA_STRING, .len = 2 }, [NL80211_ATTR_REG_RULES] = { .type = NLA_NESTED },
scripts/setlocalversion +10 -2
@@ -72,8 +72,16 @@ scm_version() printf -- '-svn%s' "`git svn find-rev $head`" fi - # Check for uncommitted changes - if git diff-index --name-only HEAD | grep -qv "^scripts/package"; then + # Check for uncommitted changes. + # First, with git-status, but --no-optional-locks is only + # supported in git >= 2.14, so fall back to git-diff-index if + # it fails. Note that git-diff-index does not refresh the + # index, so it may give misleading results. See + # git-update-index(1), git-diff-index(1), and git-status(1). + if { + git --no-optional-locks status -uno --porcelain 2>/dev/null || + git diff-index --name-only HEAD + } | grep -qvE '^(.. )?scripts/package'; then printf '%s' -dirty fi
sound/core/hrtimer.c +1 -0
@@ -159,6 +159,7 @@ static int __init snd_hrtimer_init(void) timer->hw = hrtimer_hw; timer->hw.resolution = resolution; timer->hw.ticks =NANO_SEC / resolution; + timer->max_instances =100 ;/* lower the limit */ err =snd_timer_global_register (timer);if (err <0 ) {
sound/core/timer.c +96 -45
347 lines not on this page · raw message
sound/firewire/bebob/bebob_stream.c +1 -2
@@ -253,8 +253,7 @@ int snd_bebob_stream_get_clock_src(struct snd_bebob *bebob,return err; } -static unsigned int -map_data_channels (struct snd_bebob *bebob,struct amdtp_stream *s) +static int map_data_channels (struct snd_bebob *bebob,struct amdtp_stream *s) {unsigned int sec, sections, ch, channels;unsigned int pcm, midi, location;
sound/hda/hdac_controller.c +0 -2
@@ -441,8 +441,6 @@ static void azx_int_disable(struct hdac_bus *bus)list_for_each_entry (azx_dev, &bus->stream_list, list)snd_hdac_stream_updateb (azx_dev,SD_CTL ,SD_INT_MASK ,0 ); -synchronize_irq (bus->irq); -/* disable SIE for all streams */ snd_hdac_chip_writeb (bus,INTCTL ,0 );
sound/pci/hda/hda_intel.c +1 -1
@@ -1239,9 +1239,9 @@ static int azx_free(struct azx *chip) }if (bus->chip_init) { -azx_stop_chip (chip);azx_clear_irq_pending (chip);azx_stop_all_streams (chip); +azx_stop_chip (chip); }if (bus->irq >=0 )
tools/perf/pmu-events/jevents.c +6 -6
@@ -311,12 +311,12 @@ static struct fixed {const char *name;const char *event; } fixed[] = { - { "inst_retired.any", "event=0xc0" }, - { "inst_retired.any_p", "event=0xc0" }, - { "cpu_clk_unhalted.ref", "event=0x0,umask=0x03" }, - { "cpu_clk_unhalted.thread", "event=0x3c" }, - { "cpu_clk_unhalted.core", "event=0x3c" }, - { "cpu_clk_unhalted.thread_any", "event=0x3c,any=1" }, + { "inst_retired.any", "event=0xc0,period=2000003" }, + { "inst_retired.any_p", "event=0xc0,period=2000003" }, + { "cpu_clk_unhalted.ref", "event=0x0,umask=0x03,period=2000003" }, + { "cpu_clk_unhalted.thread", "event=0x3c,period=2000003" }, + { "cpu_clk_unhalted.core", "event=0x3c,period=2000003" }, + { "cpu_clk_unhalted.thread_any", "event=0x3c,any=1,period=2000003" }, { NULL, NULL}, };
tools/perf/util/map.c +3 -0
@@ -1,4 +1,5 @@#include "symbol.h" +#include <assert.h> #include <errno.h> #include <inttypes.h> #include <limits.h>
@@ -716,6 +717,8 @@ static int maps__fixup_overlappings(struct maps *maps, struct map *map, FILE *fp } after->start = map->end; + after->pgoff += map->end - pos->start; +assert (pos->map_ip (pos, map->end) == after->map_ip (after, map->end));__map_groups__insert (pos->groups, after);if (verbose >=2 )map__fprintf (after, fp);