id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
b13683d1cc14d1dd30b8e20f3ebea3f814ad029f
Analyze and fix the following issue in the Linux kernel code: slub: add missed accounting
Problem Details: With per-cpu partial list, slab is added to partial list first and then moved to node list. The __slab_free() code path for add/remove_partial is almost deprecated(except for slub debug). But we forget to account add/remove_partial when move per-cpu partial pages to node list, so the statistics for suc...
```diff diff --git a/mm/slub.c b/mm/slub.c index 4056d29e6610..8284a206f48d 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -1901,11 +1901,14 @@ static void unfreeze_partials(struct kmem_cache *s) } if (l != m) { - if (l == M_PARTIAL) + if (l == M_PARTIAL) { remove_partial(n, page); - else + stat...
c3b79770e51ab1fd4201f3b54edf30113b9ce74f
Analyze and fix the following issue in the Linux kernel code: rtc: m41t80: Workaround broken alarm functionality
Problem Details: The m41t80 driver can read and set the alarm, but it doesn't seem to have a functional alarm irq. This causes failures when the generic core sees alarm functions, but then cannot use them properly for things like UIE mode. Disabling the alarm functions allows proper error reporting, and possible fall...
```diff diff --git a/drivers/rtc/rtc-m41t80.c b/drivers/rtc/rtc-m41t80.c index eda128fc1d38..64aedd8cc095 100644 --- a/drivers/rtc/rtc-m41t80.c +++ b/drivers/rtc/rtc-m41t80.c @@ -357,10 +357,19 @@ static int m41t80_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *t) static struct rtc_class_ops m41t80_rtc_ops = { ...
8f1e33daeda6cd89753f9e77d174805a6f21db09
Analyze and fix the following issue in the Linux kernel code: slub: Switch per cpu partial page support off for debugging
Problem Details: Eric saw an issue with accounting of slabs during validation. Its not possible to determine accurately how many per cpu partial slabs exist at any time so this switches off per cpu partial pages during debug. Acked-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: Christoph Lameter <cl@linux.co...
```diff diff --git a/mm/slub.c b/mm/slub.c index ed3334d9b6da..4056d29e6610 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -3028,7 +3028,9 @@ static int kmem_cache_open(struct kmem_cache *s, * per node list when we run out of per cpu objects. We only fetch 50% * to keep some capacity around for frees. */ - if...
73736e0387ba0e6d2b703407b4d26168d31516a7
Analyze and fix the following issue in the Linux kernel code: slub: fix a possible memleak in __slab_alloc()
Problem Details: Zhihua Che reported a possible memleak in slub allocator on CONFIG_PREEMPT=y builds. It is possible current thread migrates right before disabling irqs in __slab_alloc(). We must check again c->freelist, and perform a normal allocation instead of scratching c->freelist. Many thanks to Zhihua Che for ...
```diff diff --git a/mm/slub.c b/mm/slub.c index 108ed03fb422..5e410a95abaf 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -2169,6 +2169,11 @@ redo: goto new_slab; } + /* must check again c->freelist in case of cpu migration or IRQ */ + object = c->freelist; + if (object) + goto load_freelist; + stat(s, ALLOC_SLOW...
1ff97647f066aef72ae68042c9abc4a837a12e6d
Analyze and fix the following issue in the Linux kernel code: char_dev.c: fix up some whitespace errors
Problem Details: Remove some minor whitespace errors (2 trailing spaces, and one space needed for a comma) to make the file checkpatch.pl clean with the exception of the exports, which is fine for now. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
```diff diff --git a/fs/char_dev.c b/fs/char_dev.c index dca9e5e0f73b..3f152b92a94a 100644 --- a/fs/char_dev.c +++ b/fs/char_dev.c @@ -272,7 +272,7 @@ int __register_chrdev(unsigned int major, unsigned int baseminor, cd = __register_chrdev_region(major, baseminor, count, name); if (IS_ERR(cd)) return PTR_ERR(cd)...
b2404f4275badc719b8335420c97ae9380e01227
Analyze and fix the following issue in the Linux kernel code: ARM: OMAP3: cm-t35: fix mux mode for DSS pins
Problem Details: OMAP pin mux configuration API has been used incorrectly resulting in wrong mux mode set for several DSS pins. Signed-off-by: Igor Grinberg <grinberg@compulab.co.il> Signed-off-by: Tony Lindgren <tony@atomide.com>
```diff diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c index 865f96da771e..b38cd7b240e8 100644 --- a/arch/arm/mach-omap2/board-cm-t35.c +++ b/arch/arm/mach-omap2/board-cm-t35.c @@ -600,24 +600,28 @@ static void __init cm_t3x_common_dss_mux_init(int mux_mode) static void __init c...
b74f149cc9f58583ec22ba5180d2b5d00920bfbe
Analyze and fix the following issue in the Linux kernel code: ARM: OMAP3: cm-t35: Add regulator for ads7846 touchscreen
Problem Details: ads7846 driver fails to find the regulator supply and as a result the touchscreen is not working. Fix this by adding a regulator supply for the ads7846 driver. Signed-off-by: Igor Grinberg <grinberg@compulab.co.il> [tony@atomide.com: updated subject] Signed-off-by: Tony Lindgren <tony@atomide.com>
```diff diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c index 510b6a2ff0fa..a4dbbe7adb73 100644 --- a/arch/arm/mach-omap2/board-cm-t35.c +++ b/arch/arm/mach-omap2/board-cm-t35.c @@ -343,6 +343,10 @@ static struct regulator_consumer_supply cm_t35_vdvi_supply[] = { REGULATOR_SUPPLY(...
9f048bfba15a22d1d1ce0c1f44567fa16bed4d25
Analyze and fix the following issue in the Linux kernel code: net: fix build error if CONFIG_CGROUPS=n
Problem Details: Reported-by: Christoph Paasch <christoph.paasch@uclouvain.be> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/include/net/sock.h b/include/net/sock.h index 18ecc9919d29..6fe0dae81451 100644 --- a/include/net/sock.h +++ b/include/net/sock.h @@ -64,6 +64,8 @@ #include <net/dst.h> #include <net/checksum.h> +struct cgroup; +struct cgroup_subsys; int mem_cgroup_sockets_init(struct cgroup *cgrp, struct cgro...
11ac75ed1eb9d8f5ff067fa9a82ebf5075989281
Analyze and fix the following issue in the Linux kernel code: be2net: refactor/cleanup vf configuration code
Problem Details: - use adapter->num_vfs (and not the module param) to store the actual number of vfs created. Use the same variable to reflect SRIOV enable/disable state. So, drop the adapter->sriov_enabled field. - use for_all_vfs() macro in VF configuration code - drop the "vf_" prefix for the fields of be_vf_cfg; ...
```diff diff --git a/drivers/net/ethernet/emulex/benet/be.h b/drivers/net/ethernet/emulex/benet/be.h index 34f162db9f2e..a3588fb8d6a9 100644 --- a/drivers/net/ethernet/emulex/benet/be.h +++ b/drivers/net/ethernet/emulex/benet/be.h @@ -288,11 +288,11 @@ struct be_drv_stats { }; struct be_vf_cfg { - unsigned char vf_...
110b82bc6265a48c1a0bf198109bed325ed055e2
Analyze and fix the following issue in the Linux kernel code: be2net: fix ethtool ringparam reporting
Problem Details: The ethtool "-g" option is supposed to report the max queue length and user modified queue length for RX and TX queues. be2net doesn't support user modification of queue lengths. So, the correct values for these would be the max numbers. be2net incorrectly reports the queue used values for these field...
```diff diff --git a/drivers/net/ethernet/emulex/benet/be_ethtool.c b/drivers/net/ethernet/emulex/benet/be_ethtool.c index 575c78306313..6ba2dc6bdf7b 100644 --- a/drivers/net/ethernet/emulex/benet/be_ethtool.c +++ b/drivers/net/ethernet/emulex/benet/be_ethtool.c @@ -520,16 +520,13 @@ static int be_get_settings(struct n...
f9ea14efa5277c47efec341dee2c408b6b80f854
Analyze and fix the following issue in the Linux kernel code: gpio-ml-ioh: fix a bug in the interrupt handler
Problem Details: GPIO's irq action's dev_id is set to the first struct ioh_gpio chip, so when loop checking the 8 chips, the "chip" should be changed according. Signed-off-by: Feng Tang <feng.tang@intel.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
```diff diff --git a/drivers/gpio/gpio-ml-ioh.c b/drivers/gpio/gpio-ml-ioh.c index ea8e73869250..92b6f51a206e 100644 --- a/drivers/gpio/gpio-ml-ioh.c +++ b/drivers/gpio/gpio-ml-ioh.c @@ -339,7 +339,7 @@ static irqreturn_t ioh_gpio_handler(int irq, void *dev_id) int i, j; int ret = IRQ_NONE; - for (i = 0; i < 8; i...
5c2f37dddd963df61aed14283adb98067fb6afe5
Analyze and fix the following issue in the Linux kernel code: serial: make FSL errata depend on 8250_CONSOLE, not just 8250
Problem Details: The recent commit "serial: add irq handler for Freescale 16550 errata" would allow Kconfig choices that had 8250 support as a module and yet still try and build in the errata fix non-modular, resulting in build failures for some non-embedded PPC targets. Since we hook in the errata fix from legacy_ser...
```diff diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig index fee9e04f42e7..d1e4f203ae61 100644 --- a/drivers/tty/serial/Kconfig +++ b/drivers/tty/serial/Kconfig @@ -99,7 +99,7 @@ config SERIAL_8250_PNP config SERIAL_8250_FSL bool - depends on SERIAL_8250 && PPC + depends on SERIAL_8250_CONSOL...
6a82c47aa84ab22cb5969a44105cca5358879d21
Analyze and fix the following issue in the Linux kernel code: ceph: fix SEEK_CUR, SEEK_SET regression
Problem Details: Commit 06222e491e663dac939f04b125c9dc52126a75c4 got the if wrong so that it always evaluates as true. This is semantically harmless, but makes SEEK_CUR and SEEK_SET needlessly query the server. Rewrite the if to explicitly enumerate the cases we DO need a valid i_size to make this code less fragile. ...
```diff diff --git a/fs/ceph/file.c b/fs/ceph/file.c index af187330cc89..ed72428d9c75 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c @@ -797,7 +797,8 @@ static loff_t ceph_llseek(struct file *file, loff_t offset, int origin) mutex_lock(&inode->i_mutex); __ceph_do_pending_vmtruncate(inode); - if (origin != SEEK_...
3c8ed88974472b928489e3943616500ce2ad0cd8
Analyze and fix the following issue in the Linux kernel code: kref: Remove the memory barriers
Problem Details: Commit 1b0b3b9980e ("kref: fix CPU ordering with respect to krefs") wrongly adds memory barriers to kref. It states: some atomic operations are only atomic, not ordered. Thus a CPU is allowed to reorder memory references to an object to before the reference is obtained. This fixes it. While tr...
```diff diff --git a/include/linux/kref.h b/include/linux/kref.h index fa9907a541e2..d66c88a3b48c 100644 --- a/include/linux/kref.h +++ b/include/linux/kref.h @@ -29,7 +29,6 @@ struct kref { static inline void kref_init(struct kref *kref) { atomic_set(&kref->refcount, 1); - smp_mb(); } /** @@ -40,7 +39,6 @@ sta...
989e986f5b1748fe3ff714954dc0d23780c43a9c
Analyze and fix the following issue in the Linux kernel code: UAPI: Fix AHZ multiple inclusion when __KERNEL__ is removed
Problem Details: Fix AHZ multiple inclusion when __KERNEL__ is removed as part of the separation of the userspace headers from the kernel headers. Signed-off-by: David Howells <dhowells@redhat.com>
```diff diff --git a/include/linux/acct.h b/include/linux/acct.h index 3e4737fa6cce..d537aa0ec414 100644 --- a/include/linux/acct.h +++ b/include/linux/acct.h @@ -146,6 +146,9 @@ extern void acct_exit_ns(struct pid_namespace *); * */ +#undef ACCT_VERSION +#undef AHZ + #ifdef CONFIG_BSD_PROCESS_ACCT_V3 #define A...
935a9fee51c945b8942be2d7b4bae069167b4886
Analyze and fix the following issue in the Linux kernel code: ibft: Fix finding IBFT ACPI table on UEFI
Problem Details: Found one system with UEFI/iBFT, kernel does not detect the iBFT during iscsi_ibft module loading. Root cause: on x86 (UEFI), we are calling of find_ibft_region() much earlier - specifically in setup_arch() before ACPI is enabled. Try to split acpi checking code out and call that later At that time ...
```diff diff --git a/drivers/firmware/iscsi_ibft.c b/drivers/firmware/iscsi_ibft.c index c811cb107904..2cce44a1d7d0 100644 --- a/drivers/firmware/iscsi_ibft.c +++ b/drivers/firmware/iscsi_ibft.c @@ -746,6 +746,37 @@ static void __exit ibft_exit(void) ibft_cleanup(); } +#ifdef CONFIG_ACPI +static const struct { + c...
e2ef36c688d5844a986424c3194bd33212c968ce
Analyze and fix the following issue in the Linux kernel code: ALSA: hda: fix mute led polarity for HP laptops with buggy BIOS
Problem Details: Some HP laptop models do not have a properly filled OEM string used to set the gpio and polarity of the mute led. Make the mute led configuration work for this case. Signed-off-by: Gustavo Maciel Dias Vieira <gustavo@sagui.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
```diff diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index eeb25d529e30..616678fde486 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c @@ -4929,6 +4929,12 @@ static int find_mute_led_gpio(struct hda_codec *codec, int default_polarity) set_hp_led_gpio(...
277d90f4ba4b7ebb35b85a5d6c58dce2f1e1b58d
Analyze and fix the following issue in the Linux kernel code: ath6kl: fix reading of FW IE capabilities
Problem Details: For some strange reason I used ALIGN() to calculate index to the buffer. That is totally bogus and wouldn't work when it tried to read the second bit. Fix it by removing the ALIGN() altogether. Also check that ie_len is not too short. Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
```diff diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c index c97f83ca0ff2..5753f00a0c0d 100644 --- a/drivers/net/wireless/ath/ath6kl/init.c +++ b/drivers/net/wireless/ath/ath6kl/init.c @@ -913,12 +913,15 @@ static int ath6kl_fetch_fw_api2(struct ath6kl *ar) ar->hw.r...
75ae3bc48fc8f5d1e5f5fe43cd07078325a6194b
Analyze and fix the following issue in the Linux kernel code: ath6kl: fix value of WOW_FILTER_SSID
Problem Details: According to the firmware engineers WOW_FILTER_SSID is actually the second bit, not the first. Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
```diff diff --git a/drivers/net/wireless/ath/ath6kl/wmi.h b/drivers/net/wireless/ath/ath6kl/wmi.h index 4e4f0f763ae5..cbde79c5d7cb 100644 --- a/drivers/net/wireless/ath/ath6kl/wmi.h +++ b/drivers/net/wireless/ath/ath6kl/wmi.h @@ -1808,7 +1808,7 @@ struct wmi_set_ip_cmd { } __packed; enum ath6kl_wow_filters { - WOW...
c97a31b002d34595f74d2cb0d8017c183e7157d4
Analyze and fix the following issue in the Linux kernel code: ath6kl: remove a workaround from ath6kl_cfg80211_stop()
Problem Details: There's a workaround in ath6kl_cfg80211_stop() which emits disconnected even when sme_state was disconnected. This is legacy from the old staging driver and I can't repoduce the old problem anymore. I assume the bug got fixed while the driver was cleaned up so let's get rid of the hack. This makes it ...
```diff diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c index a58bea486b7b..9dd1f48977aa 100644 --- a/drivers/net/wireless/ath/ath6kl/cfg80211.c +++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c @@ -2405,6 +2405,8 @@ void ath6kl_cfg80211_stop(struct ath6kl *ar) } ...
4703290af46c73094b5252f0cd643c64613c2cb2
Analyze and fix the following issue in the Linux kernel code: ath6kl: Use delayed key configuration for WAPI in AP mode
Problem Details: This is needed to allow WAPI AP to configure the initial group key to the target in the same way as is done with TKIP/CCMP. This fixes broadcast data frame delivery with the initial group key. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
```diff diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c index 92d862dea584..a2dd0fc05b91 100644 --- a/drivers/net/wireless/ath/ath6kl/cfg80211.c +++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c @@ -999,7 +999,8 @@ static int ath6kl_cfg80211_add_key(struct wiphy *wiph...
c411cc88d873b3f68635a04691f7f115c46bc39e
Analyze and fix the following issue in the Linux kernel code: fuse: Use kcalloc instead of kzalloc to allocate array
Problem Details: The advantage of kcalloc is, that will prevent integer overflows which could result from the multiplication of number of elements and size and it is also a bit nicer to read. The semantic patch that makes this change is available in https://lkml.org/lkml/2011/11/25/107 Signed-off-by: Thomas Meyer <th...
```diff diff --git a/fs/fuse/file.c b/fs/fuse/file.c index e0b60acfe726..c297425cba71 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -1776,7 +1776,7 @@ long fuse_do_ioctl(struct file *file, unsigned int cmd, unsigned long arg, BUILD_BUG_ON(sizeof(struct fuse_ioctl_iovec) * FUSE_IOCTL_MAX_IOV > PAGE_SIZE); er...
73104b6e37f75f822e3dcf016147c322d1f6dad9
Analyze and fix the following issue in the Linux kernel code: fuse: llseek fix race
Problem Details: Fix race between lseek(fd, 0, SEEK_CUR) and read/write. This was fixed in generic code by commit 5b6f1eb97d (vfs: lseek(fd, 0, SEEK_CUR) race condition). Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
```diff diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 19029e97ca2f..0c84100acd44 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -1567,6 +1567,10 @@ static loff_t fuse_file_llseek(struct file *file, loff_t offset, int origin) offset += i_size_read(inode); break; case SEEK_CUR: + if (offset == 0) { + ...
b48c6af2086ab2ba8a9c9b6ce9ecb34592ce500c
Analyze and fix the following issue in the Linux kernel code: fuse: fix llseek bug
Problem Details: The test in fuse_file_llseek() "not SEEK_CUR or not SEEK_SET" always evaluates to true. This was introduced in 3.1 by commit 06222e49 (fs: handle SEEK_HOLE/SEEK_DATA properly in all fs's that define their own llseek) and changed the behavior of SEEK_CUR and SEEK_SET to always retrieve the file attribu...
```diff diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 594f07a81c28..19029e97ca2f 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -1556,7 +1556,7 @@ static loff_t fuse_file_llseek(struct file *file, loff_t offset, int origin) struct inode *inode = file->f_path.dentry->d_inode; mutex_lock(&inode->i_mutex);...
48706d0a91583d08c56e7ef2a7602d99c8d4133f
Analyze and fix the following issue in the Linux kernel code: fuse: fix fuse_retrieve
Problem Details: Fix two bugs in fuse_retrieve(): - retrieving more than one page would yield repeated instances of the first page - if more than FUSE_MAX_PAGES_PER_REQ pages were requested than the request page array would overflow fuse_retrieve() was added in 2.6.36 and these bugs had been there since the ...
```diff diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index 5cb8614508c3..2aaf3eaaf13d 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -1512,7 +1512,7 @@ static int fuse_retrieve(struct fuse_conn *fc, struct inode *inode, else if (outarg->offset + num > file_size) num = file_size - outarg->offset; - while (num) {...
e9356f4da3ffba7ab826ec3ea5f31f414f5b2a95
Analyze and fix the following issue in the Linux kernel code: UAPI: Fix nested __KERNEL__ guards in video/edid.h
Problem Details: Fix nested __KERNEL__ guards in video/edid.h to make parsing easier. Signed-off-by: David Howells <dhowells@redhat.com>
```diff diff --git a/include/video/edid.h b/include/video/edid.h index 928c342b33d6..c5f198704912 100644 --- a/include/video/edid.h +++ b/include/video/edid.h @@ -1,16 +1,14 @@ #ifndef __linux_video_edid_h__ #define __linux_video_edid_h__ -#if !defined(__KERNEL__) || defined(CONFIG_X86) - struct edid_info { unsi...
c245dcd326fb9f8cca4b396796f0d2e54171b5c9
Analyze and fix the following issue in the Linux kernel code: ARM: 7208/1: Add condition code checking to SWP emulation handler.
Problem Details: This patch fixes two separate issues with the SWP emulation handler: 1: Certain processors implementing ARMv7-A can (legally) take an undef exception even when the condition code would have meant that the instruction should not have been executed. 2: Opcodes with all flags set (condition code = 0...
```diff diff --git a/arch/arm/kernel/swp_emulate.c b/arch/arm/kernel/swp_emulate.c index 5f452f8fde05..df745188f5de 100644 --- a/arch/arm/kernel/swp_emulate.c +++ b/arch/arm/kernel/swp_emulate.c @@ -25,6 +25,7 @@ #include <linux/syscalls.h> #include <linux/perf_event.h> +#include <asm/opcodes.h> #include <asm/trap...
13c07b0286d340275f2d97adf085cecda37ede37
Analyze and fix the following issue in the Linux kernel code: linux/log2.h: Fix rounddown_pow_of_two(1)
Problem Details: Exactly like roundup_pow_of_two(1), the rounddown version was buggy for the case of a compile-time constant '1' argument. Probably because it originated from the same code, sharing history with the roundup version from before the bugfix (for that one, see commit 1a06a52ee1b0: "Fix roundup_pow_of_two(1...
```diff diff --git a/include/linux/log2.h b/include/linux/log2.h index 25b808631cd9..fd7ff3d91e6a 100644 --- a/include/linux/log2.h +++ b/include/linux/log2.h @@ -185,7 +185,6 @@ unsigned long __rounddown_pow_of_two(unsigned long n) #define rounddown_pow_of_two(n) \ ( \ __builtin_constant_p(n) ? ( \ - (n =...
8fe64955e47277abf4a3ec56383ea9b9487bd029
Analyze and fix the following issue in the Linux kernel code: staging:iio:kfifo_buf: Fix potential buffer overflow in iio_read_first_n_kfifo
Problem Details: n is the number of bytes to read, not the number of samples. So if there is enough data available we will write to the userspace buffer beyond its bounds. Fix this by copying n bytes maximum. Also round n down to the next multiple of the sample size, so we will only read complete samples. If the buffer...
```diff diff --git a/drivers/staging/iio/buffer.h b/drivers/staging/iio/buffer.h index c69709925ba2..44593b28b36f 100644 --- a/drivers/staging/iio/buffer.h +++ b/drivers/staging/iio/buffer.h @@ -21,7 +21,7 @@ struct iio_buffer; * @mark_in_use: reference counting, typically to prevent module removal * @unmark_in_use...
8b34a1fb1e3f35eb4c9efa1d8df90d2b17332547
Analyze and fix the following issue in the Linux kernel code: staging: bcm: HandleControlPacket.c: fix parens/braces
Problem Details: Signed-off-by: Johannes Tenschert <Johannes.Tenschert@informatik.stud.uni-erlangen.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
```diff diff --git a/drivers/staging/bcm/HandleControlPacket.c b/drivers/staging/bcm/HandleControlPacket.c index bc5cca978701..f17530b3a732 100644 --- a/drivers/staging/bcm/HandleControlPacket.c +++ b/drivers/staging/bcm/HandleControlPacket.c @@ -24,8 +24,7 @@ static VOID handle_rx_control_packet(PMINI_ADAPTER Adapter,...
77eb7585db287d2323fe60cfe57f3c6a5cdf8787
Analyze and fix the following issue in the Linux kernel code: staging: bcm: HandleControlPacket.c: fix comments
Problem Details: Signed-off-by: Johannes Tenschert <Johannes.Tenschert@informatik.stud.uni-erlangen.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
```diff diff --git a/drivers/staging/bcm/HandleControlPacket.c b/drivers/staging/bcm/HandleControlPacket.c index 531dd1424c60..bc5cca978701 100644 --- a/drivers/staging/bcm/HandleControlPacket.c +++ b/drivers/staging/bcm/HandleControlPacket.c @@ -1,16 +1,16 @@ /** -@file HandleControlPacket.c -This file contains the r...
efa6f862d3d18723d720c8777b2a98e8a3277195
Analyze and fix the following issue in the Linux kernel code: staging: bcm: HandleControlPacket.c: fix indentation
Problem Details: Signed-off-by: Johannes Tenschert <Johannes.Tenschert@informatik.stud.uni-erlangen.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
```diff diff --git a/drivers/staging/bcm/HandleControlPacket.c b/drivers/staging/bcm/HandleControlPacket.c index e764e63c003d..531dd1424c60 100644 --- a/drivers/staging/bcm/HandleControlPacket.c +++ b/drivers/staging/bcm/HandleControlPacket.c @@ -26,42 +26,42 @@ static VOID handle_rx_control_packet(PMINI_ADAPTER Adapte...
dd751d2a2bbd619081074d25f3f2ebcb1fb29b9e
Analyze and fix the following issue in the Linux kernel code: staging: bcm: HandleControlPacket.c: fix whitespaces
Problem Details: Signed-off-by: Johannes Tenschert <Johannes.Tenschert@informatik.stud.uni-erlangen.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
```diff diff --git a/drivers/staging/bcm/HandleControlPacket.c b/drivers/staging/bcm/HandleControlPacket.c index 2b1e9e17e11c..e764e63c003d 100644 --- a/drivers/staging/bcm/HandleControlPacket.c +++ b/drivers/staging/bcm/HandleControlPacket.c @@ -13,53 +13,53 @@ Enqueue the control packet for Application. */ static V...
72b36015ba43a3cca5303f5534d2c3e1899eae29
Analyze and fix the following issue in the Linux kernel code: ipip, sit: copy parms.name after register_netdevice
Problem Details: Same fix as 731abb9cb2 for ipip and sit tunnel. Commit 1c5cae815d removed an explicit call to dev_alloc_name in ipip_tunnel_locate and ipip6_tunnel_locate, because register_netdevice will now create a valid name, however the tunnel keeps a copy of the name in the private parms structure. Fix this by co...
```diff diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c index 065effd8349a..0b2e7329abda 100644 --- a/net/ipv4/ipip.c +++ b/net/ipv4/ipip.c @@ -285,6 +285,8 @@ static struct ip_tunnel * ipip_tunnel_locate(struct net *net, if (register_netdevice(dev) < 0) goto failed_free; + strcpy(nt->parms.name, dev->name); + ...
4af04aba93f47699e7ac33e7cfd4da22550e6114
Analyze and fix the following issue in the Linux kernel code: ipv6: Fix for adding multicast route for loopback device automatically.
Problem Details: There is no obvious reason to add a default multicast route for loopback devices, otherwise there would be a route entry whose dst.error set to -ENETUNREACH that would blocking all multicast packets. ==================== [ more detailed explanation ] The problem is that the resulting routing table d...
```diff diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index cf88df82e2c2..36806def8cfd 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -1805,7 +1805,8 @@ static struct inet6_dev *addrconf_add_dev(struct net_device *dev) return ERR_PTR(-EACCES); /* Add default multicast route */ - addrconf_...
8b8ee6753154dd6cfe397e0d29fe7f90a8adb50b
Analyze and fix the following issue in the Linux kernel code: Drivers: hv: Fix a memory leak
Problem Details: There was a memory leak in a failure path in vmbus_process_offer(). Fix it. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
```diff diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c index 12b85ff957fd..b91af50875e9 100644 --- a/drivers/hv/channel_mgmt.c +++ b/drivers/hv/channel_mgmt.c @@ -287,6 +287,7 @@ static void vmbus_process_offer(struct work_struct *work) spin_lock_irqsave(&vmbus_connection.channel_lock, flags); ...
f88e1ae8acb8affac29034ed79d4fff95ac8c29d
Analyze and fix the following issue in the Linux kernel code: dt/device: Fix auxdata matching to handle entries without a name override
Problem Details: There is no requirement to override name entries in auxdata. Fix the entry matching to use .compatible instead of .name to find the end of the list. Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
```diff diff --git a/drivers/of/platform.c b/drivers/of/platform.c index cbd5d701c7e0..63b3ec48c203 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c @@ -314,7 +314,7 @@ static const struct of_dev_auxdata *of_dev_lookup(const struct of_dev_auxdata *l if (!lookup) return NULL; - for(; lookup->name !=...
15c9a0acc3f7873db4b7d35d016729b2dc229b49
Analyze and fix the following issue in the Linux kernel code: of: create of_phandle_args to simplify return of phandle parsing data
Problem Details: of_parse_phandle_with_args() needs to return quite a bit of data. Rather than making each datum a separate **out_ argument, this patch creates struct of_phandle_args to contain all the returned data and reworks the user of the function. This patch also enables of_parse_phandle_with_args() to return t...
```diff diff --git a/drivers/of/base.c b/drivers/of/base.c index 9b6588ef0673..c6db9ab9046e 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -824,17 +824,19 @@ of_parse_phandle(struct device_node *np, const char *phandle_name, int index) EXPORT_SYMBOL(of_parse_phandle); /** - * of_parse_phandles_with_args ...
10636bc2d60942254bda149827b922c41f4cb4af
Analyze and fix the following issue in the Linux kernel code: ath9k: fix max phy rate at rate control init
Problem Details: The stations always chooses 1Mbps for all trasmitting frames, whenever the AP is configured to lock the supported rates. As the max phy rate is always set with the 4th from highest phy rate, this assumption might be wrong if we have less than that. Fix that. Cc: stable@kernel.org Cc: Paul Stewart <pst...
```diff diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c index 8448281dd069..cc5703b853bc 100644 --- a/drivers/net/wireless/ath/ath9k/rc.c +++ b/drivers/net/wireless/ath/ath9k/rc.c @@ -1270,7 +1270,9 @@ static void ath_rc_init(struct ath_softc *sc, ath_rc_priv->max_valid_rate =...
f8c141c3e915e3a040d4c1badde28e23f8cbe255
Analyze and fix the following issue in the Linux kernel code: nfc: signedness bug in __nci_request()
Problem Details: wait_for_completion_interruptible_timeout() returns -ERESTARTSYS if interrupted so completion_rc needs to be signed. The current code probably returns -ETIMEDOUT if we hit this situation, but after this patch is applied it will return -ERESTARTSYS. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.c...
```diff diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c index 4047e29acb3b..25dae3f8f5c2 100644 --- a/net/nfc/nci/core.c +++ b/net/nfc/nci/core.c @@ -68,7 +68,7 @@ static int __nci_request(struct nci_dev *ndev, __u32 timeout) { int rc = 0; - unsigned long completion_rc; + long completion_rc; ndev->req_sta...
0c8551e5fa3833c6080542da662394817fea4616
Analyze and fix the following issue in the Linux kernel code: ARM: OMAP: mcbsp: Fix possible memory corruption
Problem Details: Commits 09d28d ("ARM: OMAP: mcbsp: Start generalize omap2_mcbsp_set_clks_src") and 7bc0c4 ("ARM: OMAP: mcbsp: Start generalize signal muxing functions") incorrectly set two struct omap_mcbsp_platform_data fields after omap_device_build_ss and kfree calls. Fix this by moving these pdata assignments bef...
```diff diff --git a/arch/arm/mach-omap2/mcbsp.c b/arch/arm/mach-omap2/mcbsp.c index 292eee3be15f..28fcb27005d2 100644 --- a/arch/arm/mach-omap2/mcbsp.c +++ b/arch/arm/mach-omap2/mcbsp.c @@ -145,6 +145,9 @@ static int omap_init_mcbsp(struct omap_hwmod *oh, void *unused) pdata->reg_size = 4; pdata->has_ccr = true;...
f1932fc1a6d899c754676b1dd8b17de93b052d43
Analyze and fix the following issue in the Linux kernel code: crush: fix mapping calculation when force argument doesn't exist
Problem Details: If the force argument isn't valid, we should continue calculating a mapping as if it weren't specified. Signed-off-by: Sage Weil <sage@newdream.net>
```diff diff --git a/net/ceph/crush/mapper.c b/net/ceph/crush/mapper.c index 42599e31dcad..3a94eae7abe9 100644 --- a/net/ceph/crush/mapper.c +++ b/net/ceph/crush/mapper.c @@ -477,7 +477,6 @@ int crush_do_rule(struct crush_map *map, int i, j; int numrep; int firstn; - int rc = -1; BUG_ON(ruleno >= map->max_rul...
e79c70e6e59e764fbef2a68a7d7303c3286ea7a8
Analyze and fix the following issue in the Linux kernel code: [media] pvrusb2: Use kcalloc instead of kzalloc to allocate array
Problem Details: The advantage of kcalloc is, that will prevent integer overflows which could result from the multiplication of number of elements and size and it is also a bit nicer to read. The semantic patch that makes this change is available in https://lkml.org/lkml/2011/11/25/107 Signed-off-by: Thomas Meyer <th...
```diff diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c index 122b45760f0d..ebc2c7e39233 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c +++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c @@ -2546,8 +2546,9 @@ struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *...
0b57d7602b68f7b2786b2f0e22da39cbd4139a95
Analyze and fix the following issue in the Linux kernel code: hwmon: (jz4740) fix signedness bug
Problem Details: wait_for_completion_interruptible_timeout() may return negative value. In this case, checking if (t > 0) will return true if t is unsigned. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Cc: stable@kernel.org (3.0+) Signed-off-by: Guenter Roeck <guenter.ro...
```diff diff --git a/drivers/hwmon/jz4740-hwmon.c b/drivers/hwmon/jz4740-hwmon.c index 7a48b1eb4233..3d7e590d57b7 100644 --- a/drivers/hwmon/jz4740-hwmon.c +++ b/drivers/hwmon/jz4740-hwmon.c @@ -59,7 +59,7 @@ static ssize_t jz4740_hwmon_read_adcin(struct device *dev, { struct jz4740_hwmon *hwmon = dev_get_drvdata(de...
b4611abfa98af8351bf32e8b9ecc9d3384931c37
Analyze and fix the following issue in the Linux kernel code: ext4: Fix crash due to getting bogus eh_depth value on big-endian systems
Problem Details: Commit 1939dd84b3 ("ext4: cleanup ext4_ext_grow_indepth code") added a reference to ext4_extent_header.eh_depth, but forget to pass the value read through le16_to_cpu. The result is a crash on big-endian machines, such as this crash on a POWER7 server: attempt to access beyond end of device sda8: rw=...
```diff diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index 61fa9e1614af..61cdb97f338c 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c @@ -1095,7 +1095,7 @@ static int ext4_ext_grow_indepth(handle_t *handle, struct inode *inode, le32_to_cpu(EXT_FIRST_INDEX(neh)->ei_block), ext4_idx_pblock(EXT_FIRS...
b5a7e97039a80fae673ccc115ce595d5b88fb4ee
Analyze and fix the following issue in the Linux kernel code: ext4: fix ext4_end_io_dio() racing against fsync()
Problem Details: We need to make sure iocb->private is cleared *before* we put the io_end structure on i_completed_io_list. Otherwise fsync() could potentially run on another CPU and free the iocb structure out from under us. Reported-by: Kent Overstreet <koverstreet@google.com> Signed-off-by: "Theodore Ts'o" <tytso@...
```diff diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 848f436df29f..d2c86633811f 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -2781,10 +2781,11 @@ static void ext4_end_io_dio(struct kiocb *iocb, loff_t offset, iocb->private, io_end->inode->i_ino, iocb, offset, size); + iocb->private = NULL;...
8935e13457341841a6a02b8c8f65799f18cf4804
Analyze and fix the following issue in the Linux kernel code: UAPI: Fix arch/mips/include/asm/Kbuild to have separate header-y lines
Problem Details: Fix arch/mips/include/asm/Kbuild to have a separate header-y line for each header to make them easier to relocate individually as part of the UAPI header split. Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: Ralf Baechle <ralf@linux-mips.org>
```diff diff --git a/arch/mips/include/asm/Kbuild b/arch/mips/include/asm/Kbuild index 7897f05e3165..f53f9ca73996 100644 --- a/arch/mips/include/asm/Kbuild +++ b/arch/mips/include/asm/Kbuild @@ -1,3 +1,5 @@ include include/asm-generic/Kbuild.asm -header-y += cachectl.h sgidefs.h sysmips.h +header-y += cachectl.h +he...
b302545744c031eae04a43fb1c56cc17e00a193a
Analyze and fix the following issue in the Linux kernel code: block/swim3: Locking fixes
Problem Details: The old PowerMac swim3 driver has some "interesting" locking issues, using a private lock and failing to lock the queue before completing requests, which triggered WARN_ONs among others. This rips out the private lock, makes everything operate under the block queue lock, and generally makes things sim...
```diff diff --git a/drivers/block/swim3.c b/drivers/block/swim3.c index ae3e167e17ad..89ddab127e33 100644 --- a/drivers/block/swim3.c +++ b/drivers/block/swim3.c @@ -16,6 +16,8 @@ * handle GCR disks */ +#undef DEBUG + #include <linux/stddef.h> #include <linux/kernel.h> #include <linux/sched.h> @@ -36,13 +38,1...
e7f4e73287d2915499c821b884f70f42187e2a74
Analyze and fix the following issue in the Linux kernel code: usb: musb: omap2430: fix compile warning
Problem Details: fix the following compile warning: drivers/usb/musb/omap2430.c: In function 'musb_otg_notifier_work': drivers/usb/musb/omap2430.c:279:3: warning: 'return' with a value, in function returning void drivers/usb/musb/omap2430.c:282:2: warning: 'return' with a value, in function returning void Signed-of...
```diff diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index fd5dd46039ad..c24dc26b9be2 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c @@ -283,10 +283,7 @@ static void musb_otg_notifier_work(struct work_struct *data_notifier_work) break; default: dev_dbg(musb-...
38efb539c13f8f173e381435cdd40463ab5d38de
Analyze and fix the following issue in the Linux kernel code: perf script: Fix mem leaks and NULL pointer checks around strdup()s
Problem Details: Fix mem leaks and missing NULL pointer checks after strdup(). And get_script_path() did not free __script_root in case of continue. Introduce a helper function get_script_root(). Cc: Ingo Molnar <mingo@elte.hu> Link: http://lkml.kernel.org/r/1322217520-3287-1-git-send-email-robert.richter@amd.com Si...
```diff diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index 619d6dcaa1d9..ccbfd56d7549 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c @@ -693,7 +693,8 @@ static int parse_output_fields(const struct option *opt __used, type = PERF_TYPE_RAW; else { fprintf(s...
b95eb7476e7224baae34f67ae9a09042521e97ff
Analyze and fix the following issue in the Linux kernel code: usb: renesas_usbhs: typofix: irq_dtch control DTCHE
Problem Details: Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
```diff diff --git a/drivers/usb/renesas_usbhs/mod.c b/drivers/usb/renesas_usbhs/mod.c index 053f86d70009..ad96a3896729 100644 --- a/drivers/usb/renesas_usbhs/mod.c +++ b/drivers/usb/renesas_usbhs/mod.c @@ -349,7 +349,7 @@ void usbhs_irq_callback_update(struct usbhs_priv *priv, struct usbhs_mod *mod) if (mod->irq_at...
49e85c23beb1f12aba59450126ff7e803fbc767d
Analyze and fix the following issue in the Linux kernel code: [SCSI] qla2xxx: Correct fc_host port_state display.
Problem Details: [jejb: checkpatch fixes] Add more fine grain parsing of vha->loop_state to export a more accurate fc_host port_state. Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com> Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
```diff diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index ac326c41e931..6465dae5883a 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c @@ -1762,12 +1762,31 @@ qla2x00_get_host_port_state(struct Scsi_Host *shost) scsi_qla_host_t *vha = shost_priv(shos...
712d8efafbbcbe617f9ad706f6ca1ffea4bbf2e8
Analyze and fix the following issue in the Linux kernel code: usb: musb: fix pm_runtime calls while atomic
Problem Details: musb pm_runtime_get_sync call happens in intrrupt context on cable attach case That can result in re-enabling the interrupts and cause side affects. So move the code to a work queue. Following is the error path hit on cable attach: BUG: sleeping function called from invalid context at drivers/base/p...
```diff diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h index bd2e6b8b814e..3d28fb8a2dc9 100644 --- a/drivers/usb/musb/musb_core.h +++ b/drivers/usb/musb/musb_core.h @@ -327,6 +327,7 @@ struct musb { irqreturn_t (*isr)(int, void *); struct work_struct irq_work; + struct work_struct otg_n...
ea737554451d9fae1207e84a3d2c495bbfcd3f08
Analyze and fix the following issue in the Linux kernel code: usb: musb: omap2+: fix context api's
Problem Details: RxFifoSz, TxFifoSz, RxFifoAddr, TxFifoAddr are all indexed registers. So before doing a context save or restore, INDEX register should be set, then only one gets to the right register offset. Signed-off-by: Vikram Pandita <vikram.pandita@ti.com> Signed-off-by: Anand Gadiyar <gadiyar@ti.com> Signed-of...
```diff diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index b63ab1570103..2141976d423c 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c @@ -2158,6 +2158,7 @@ static void musb_save_context(struct musb *musb) if (!epio) continue; + musb_writeb(musb_base, MU...
68d3e668d245bb8300c7c6ddbc8508ddfe352e0f
Analyze and fix the following issue in the Linux kernel code: usb: dwc3: ep0: fix for possible early delayed_status
Problem Details: There is a very small possibility (previously unimagined by us) that the whole Mass Storage delayed status happens rather early, before we even get our XferNotReady event. In that case, we will be queueing a request to ep0 while we're still on Setup Phase and we would be waiting for another usb_ep_que...
```diff diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c index d6bfc73dedbd..2f51de57593a 100644 --- a/drivers/usb/dwc3/ep0.c +++ b/drivers/usb/dwc3/ep0.c @@ -165,10 +165,13 @@ static int __dwc3_gadget_ep0_queue(struct dwc3_ep *dep, req->request.dma, req->request.length, type); dep->flags &= ~(DWC3_...
c90bfaece97c18d1ad66b9d4c717b1cb55a647ad
Analyze and fix the following issue in the Linux kernel code: usb: dwc3: gadget: fix stream enable bit
Problem Details: ep->max_streams is a mere hint to the gadget driver that 'ep' supports stream handling. Using that as a decision variable for enabling streams was my worst brain-fart to date. Instead, we should check from the Superspeed Endpoint Companion Descriptor if the endpoint has requested streams. For that we ...
```diff diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h index da523f5648a5..9e57f8e9bf17 100644 --- a/drivers/usb/dwc3/core.h +++ b/drivers/usb/dwc3/core.h @@ -348,6 +348,7 @@ struct dwc3_ep { u32 free_slot; u32 busy_slot; const struct usb_endpoint_descriptor *desc; + const struct usb_ss_ep_com...
e2617796053437df586c53e462076f74bcf268b4
Analyze and fix the following issue in the Linux kernel code: usb: dwc3: ep0: fix GetStatus handling (again)
Problem Details: previous commit fixed part of it but it was still calling usb_ep_queue() from IRQ context without loosing locks. That cannot be done otherwise we will have a recursive locking. Also, we need to assign the 'dep' pointer on dwc->ep0_usb_req otherwise we will have a NULL pointer dereference on dwc3_map_b...
```diff diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c index 1ba86a114655..d6bfc73dedbd 100644 --- a/drivers/usb/dwc3/ep0.c +++ b/drivers/usb/dwc3/ep0.c @@ -302,11 +302,14 @@ static int dwc3_ep0_handle_status(struct dwc3 *dwc, response_pkt = (__le16 *) dwc->setup_buf; *response_pkt = cpu_to_le16(usb...
5bdb1dcc63304a407e70020c1118fca1642bebaa
Analyze and fix the following issue in the Linux kernel code: usb: dwc3: ep0: handle delayed_status again
Problem Details: Since the re-worked ep0 handling (which uses HW's hints to recognize the ep0 status) we lost the delayed status handling. This is used by the file and mass storage gadget to gain some extra time so setup its internal status before it can proceed further requests. In particular the storage gadget does n...
```diff diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h index cecff5624af3..dc2db165412b 100644 --- a/drivers/usb/dwc3/core.h +++ b/drivers/usb/dwc3/core.h @@ -631,6 +631,7 @@ struct dwc3 { unsigned ep0_bounced:1; unsigned ep0_expect_in:1; unsigned start_config_issued:1; + unsigned delayed_stat...
8becf2704415d2bf471a0a73ae84c3cc24da8a90
Analyze and fix the following issue in the Linux kernel code: usb: dwc3: fix sparse errors
Problem Details: sparse caught three mistakes on this driver, fix them: drivers/usb/dwc3/ep0.c:806:29: warning: duplicate const drivers/usb/dwc3/debugfs.c:481:15: warning: symbol 'dwc3_debugfs_init' \ was not declared. Should it be static? drivers/usb/dwc3/debugfs.c:518:16: warning: symbol 'dwc3_debugfs_exit' \ was ...
```diff diff --git a/drivers/usb/dwc3/debugfs.c b/drivers/usb/dwc3/debugfs.c index e78abb438b4b..87d403df1f3f 100644 --- a/drivers/usb/dwc3/debugfs.c +++ b/drivers/usb/dwc3/debugfs.c @@ -49,6 +49,7 @@ #include "core.h" #include "gadget.h" #include "io.h" +#include "debug.h" struct dwc3_register { const char *na...
25b8ff68bf1d4954d4a9dcb4862c6b6a53cb09e2
Analyze and fix the following issue in the Linux kernel code: usb: dwc3: fix few coding style problems
Problem Details: There were a few coding style issues with this driver which are now fixed: drivers/usb/dwc3/debugfs.c:48: WARNING: Use #include \ <linux/uaccess.h> instead of <asm/uaccess.h> drivers/usb/dwc3/debugfs.c:484: ERROR: space required \ before the open brace '{' drivers/usb/dwc3/ep0.c:261: WARNING: line o...
```diff diff --git a/drivers/usb/dwc3/debugfs.c b/drivers/usb/dwc3/debugfs.c index ca4be0afc33d..e78abb438b4b 100644 --- a/drivers/usb/dwc3/debugfs.c +++ b/drivers/usb/dwc3/debugfs.c @@ -44,8 +44,7 @@ #include <linux/debugfs.h> #include <linux/seq_file.h> #include <linux/delay.h> - -#include <asm/uaccess.h> +#includ...
c2da2ff00606ae008f0e233bd29c3307d0c3ce85
Analyze and fix the following issue in the Linux kernel code: usb: dwc3: ep0: don't use ep0in for transfers
Problem Details: In "usb: dwc3: remove special status request handling in ep0" I simplied a few things and used the generic API for the status transfers. The bug I introcuded here is that we queue now requests to dep[1] but we don't clear that list in the stall+start case. Actually we don't need to use dep[1] at all. W...
```diff diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c index 7760d00cb902..7da25e181889 100644 --- a/drivers/usb/dwc3/ep0.c +++ b/drivers/usb/dwc3/ep0.c @@ -190,8 +190,7 @@ int dwc3_gadget_ep0_queue(struct usb_ep *ep, struct usb_request *request, } /* we share one TRB for ep0/1 */ - if (!list_empty(...
2bcb75144027fcee878319de87a967a4dec49403
Analyze and fix the following issue in the Linux kernel code: usb: gadget: mv_udc: replace some debug info
Problem Details: replace some debug info, make it easy to use. Signed-off-by: Neil Zhang <zhangwm@marvell.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
```diff diff --git a/drivers/usb/gadget/mv_udc_core.c b/drivers/usb/gadget/mv_udc_core.c index 143925c6a184..b229edeb2bb6 100644 --- a/drivers/usb/gadget/mv_udc_core.c +++ b/drivers/usb/gadget/mv_udc_core.c @@ -1230,10 +1230,11 @@ static int mv_udc_vbus_session(struct usb_gadget *gadget, int is_active) udc = containe...
9823a52539adce658f2414e33f2838b896ea4971
Analyze and fix the following issue in the Linux kernel code: usb: gadget: Use kcalloc instead of kzalloc to allocate array
Problem Details: The advantage of kcalloc is, that will prevent integer overflows which could result from the multiplication of number of elements and size and it is also a bit nicer to read. The semantic patch that makes this change is available in https://lkml.org/lkml/2011/11/25/107 Signed-off-by: Thomas Meyer <th...
```diff diff --git a/drivers/usb/gadget/f_fs.c b/drivers/usb/gadget/f_fs.c index acb38004eec0..da9d04815ea5 100644 --- a/drivers/usb/gadget/f_fs.c +++ b/drivers/usb/gadget/f_fs.c @@ -1408,7 +1408,7 @@ static int ffs_epfiles_create(struct ffs_data *ffs) ENTER(); count = ffs->eps_count; - epfiles = kzalloc(count * ...
ab14230854aba9d0c99b3cd0e4bb1ef430973d84
Analyze and fix the following issue in the Linux kernel code: usb: gadget: renesas_usbhs: check device0 status when alloc
Problem Details: device0 was treated without checking in usbhsh_device_alloc(). but "udev->usbv" and "dev_set_drvdata()" will be overwritten if device0 was multi-allocated. This patch fixes this issue. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
```diff diff --git a/drivers/usb/renesas_usbhs/mod_host.c b/drivers/usb/renesas_usbhs/mod_host.c index 3f1eaf15e0ba..e6fd044adfa3 100644 --- a/drivers/usb/renesas_usbhs/mod_host.c +++ b/drivers/usb/renesas_usbhs/mod_host.c @@ -153,6 +153,7 @@ static const char usbhsh_hcd_name[] = "renesas_usbhs host"; #define usbhsh_u...
1c89fe3b51a2f8068f2f9faa9c48584151416583
Analyze and fix the following issue in the Linux kernel code: ALSA: HDA: Set position fix to LPIB for an Atom/Poulsbo based device
Problem Details: For the Asus 1101HA, reporting position by reading the DMA position buffer map seems unstable and often wrong. The reporter says that position_fix=LPIB works much better (although not 100%, but this is probably due to other issues). The controller chip is an Intel Poulsbo 8086:811b (rev 07) controller...
```diff diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 7d98240def0b..84d11d7ed710 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -2507,6 +2507,7 @@ static struct snd_pci_quirk position_fix_list[] __devinitdata = { SND_PCI_QUIRK(0x1043, 0x813d, "ASUS P5AD2", POS_FIX...
017beaa63bd8034b6c6c0f964a57f54973f59f17
Analyze and fix the following issue in the Linux kernel code: ARM: ux500: update the MOP500 GPIO assignments
Problem Details: This is a more complete list of the MOP500 GPIO pins, especially for those used with the Snowball board. Sort GPIO number in falling number order so there is some structure to this file. Fix some whitespace issues in the process. Cc: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com> Signed-off-by...
```diff diff --git a/arch/arm/mach-ux500/board-mop500.h b/arch/arm/mach-ux500/board-mop500.h index e82552ae97e3..f926d3db6207 100644 --- a/arch/arm/mach-ux500/board-mop500.h +++ b/arch/arm/mach-ux500/board-mop500.h @@ -7,35 +7,71 @@ #ifndef __BOARD_MOP500_H #define __BOARD_MOP500_H -/* snowball GPIO for MMC card */...
8521478f67e95ada4e87970c7b41e504c724b2cf
Analyze and fix the following issue in the Linux kernel code: Input: synaptics - fix touchpad not working after S2R on Vostro V13
Problem Details: Synaptics touchpads on several Dell laptops, particularly Vostro V13 systems, may not respond properly to PS/2 commands and queries immediately after resuming from suspend to RAM. This leads to unresponsive touchpad after suspend/resume cycle. Adding a 1-second delay after resetting the device allows ...
```diff diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c index c080b828e5dc..a6dcd18e9adf 100644 --- a/drivers/input/mouse/synaptics.c +++ b/drivers/input/mouse/synaptics.c @@ -24,6 +24,7 @@ */ #include <linux/module.h> +#include <linux/delay.h> #include <linux/dmi.h> #include <linu...
3a7f8fb1d8c9b6a066b0452cea47c85547c97723
Analyze and fix the following issue in the Linux kernel code: Input: cma3000_d0x - fix signedness bug in cma3000_thread_irq()
Problem Details: The error check (intr_status < 0) didn't work because intr_status is a u8. Change its type to signed int. Signed-off-by: Xi Wang <xi.wang@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
```diff diff --git a/drivers/input/misc/cma3000_d0x.c b/drivers/input/misc/cma3000_d0x.c index 1633b6342267..09f8f2025580 100644 --- a/drivers/input/misc/cma3000_d0x.c +++ b/drivers/input/misc/cma3000_d0x.c @@ -114,8 +114,8 @@ static void decode_mg(struct cma3000_accl_data *data, int *datax, static irqreturn_t cma3000...
497d496598f411cb7f0690725a0e8b9029cebdb9
Analyze and fix the following issue in the Linux kernel code: ASoC: Fix hx4700 error handling to free gpios if snd_soc_register_card fails
Problem Details: Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
```diff diff --git a/sound/soc/pxa/hx4700.c b/sound/soc/pxa/hx4700.c index 65c124831a00..c664e33fb6d7 100644 --- a/sound/soc/pxa/hx4700.c +++ b/sound/soc/pxa/hx4700.c @@ -209,9 +209,10 @@ static int __devinit hx4700_audio_probe(struct platform_device *pdev) snd_soc_card_hx4700.dev = &pdev->dev; ret = snd_soc_regist...
3f865490698871bf77eebce05208fd08e9b45aeb
Analyze and fix the following issue in the Linux kernel code: mac80211: drop spelling fix
Problem Details: This is a partial revert of 42b2aa86c667 ("treewide: Fix typos in various parts of the kernel, and fix some comments") as the code has been refactored in the wireless tree. Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
```diff diff --git a/net/mac80211/work.c b/net/mac80211/work.c index 2accea37742e..6c53b6d1002b 100644 --- a/net/mac80211/work.c +++ b/net/mac80211/work.c @@ -1094,7 +1094,7 @@ static void ieee80211_work_work(struct work_struct *work) local->tmp_channel = NULL; /* If tmp_channel wasn't operating channel, then ...
a469ebd56f8bee8d5352b1a284ea39d23ba02430
Analyze and fix the following issue in the Linux kernel code: types.h: fix comment spelling for 'architectures'
Problem Details: Spelling change, architetures -> architectures Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
```diff diff --git a/include/linux/types.h b/include/linux/types.h index 57a97234bec1..cbcef6ebeba9 100644 --- a/include/linux/types.h +++ b/include/linux/types.h @@ -188,7 +188,7 @@ typedef __u32 __bitwise __wsum; * aligned_u64 should be used in defining kernel<->userspace ABIs to avoid * common 32/64-bit compat p...
1ded132d4c3442aa3a619c94c245d7b5e0eb9731
Analyze and fix the following issue in the Linux kernel code: be2net: workaround to fix a bug in BE
Problem Details: disable Tx vlan offloading in certain cases. Signed-off-by: Ajit Khaparde <ajit.khaparde@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c index 73fe38928c2b..62f55145fa44 100644 --- a/drivers/net/ethernet/emulex/benet/be_main.c +++ b/drivers/net/ethernet/emulex/benet/be_main.c @@ -552,11 +552,26 @@ static inline void wrb_fill(struct be_eth_wrb *...
02fe7027961969a052fbbe453304f329d4e9735a
Analyze and fix the following issue in the Linux kernel code: be2net: update some counters to display via ethtool
Problem Details: update pmem_fifo_overflow_drop, rx_priority_pause_frames counters. Signed-off-by: Ajit Khaparde <ajit.khaparde@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c index b8a526f9efc8..73fe38928c2b 100644 --- a/drivers/net/ethernet/emulex/benet/be_main.c +++ b/drivers/net/ethernet/emulex/benet/be_main.c @@ -316,6 +316,8 @@ static void populate_be3_stats(struct be_adapter ...
4f0c28f77932c51ba7639a6174047ec8c6560116
Analyze and fix the following issue in the Linux kernel code: kconfig: fix set but not used warnings
Problem Details: Remove set but not used variables to fix warnings. HOSTCC scripts/kconfig/gconf.o /usr/src/lto/scripts/kconfig/gconf.c: In function 'change_sym_value': /usr/src/lto/scripts/kconfig/gconf.c:833:11: warning: variable 'oldval' set but not used [-Wunused-but-set-variable] /usr/src/lto/scripts/kconfig/g...
```diff diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c index b9e26a56c45d..adc230638c5b 100644 --- a/scripts/kconfig/gconf.c +++ b/scripts/kconfig/gconf.c @@ -830,7 +830,7 @@ static void renderer_edited(GtkCellRendererText * cell, static void change_sym_value(struct menu *menu, gint col) { struct sy...
a7d6f6e407d617da7a3cda8865e593523eb6ee80
Analyze and fix the following issue in the Linux kernel code: kconfig: fix warnings by specifing format arguments
Problem Details: Specify format arguments to fix warnings. HOSTCC scripts/kconfig/gconf.o /usr/src/lto/scripts/kconfig/gconf.c: In function 'on_introduction1_activate': /usr/src/lto/scripts/kconfig/gconf.c:686:6: warning: format not a string literal and no format arguments /usr/src/lto/scripts/kconfig/gconf.c: In f...
```diff diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c index 9f4438027df4..b9e26a56c45d 100644 --- a/scripts/kconfig/gconf.c +++ b/scripts/kconfig/gconf.c @@ -683,7 +683,7 @@ void on_introduction1_activate(GtkMenuItem * menuitem, gpointer user_data) dialog = gtk_message_dialog_new(GTK_WINDOW(main_wnd)...
f0e7c19db8798b4b991a2c71911e71f5dfdb348f
Analyze and fix the following issue in the Linux kernel code: rcu: Identify dyntick-idle CPUs on first force_quiescent_state() pass
Problem Details: Fixes and workarounds for a number of issues (for example, that in df4012edc) make it safe to once again detect dyntick-idle CPUs on the first pass of force_quiescent_state(), so this commit makes that change. Signed-off-by: Paul E. McKenney <paul.mckenney@linaro.org> Signed-off-by: Paul E. McKenney <...
```diff diff --git a/kernel/rcutree.c b/kernel/rcutree.c index aab9ed504b17..69bb37287cc8 100644 --- a/kernel/rcutree.c +++ b/kernel/rcutree.c @@ -607,7 +607,7 @@ int rcu_is_cpu_rrupt_from_idle(void) static int dyntick_save_progress_counter(struct rcu_data *rdp) { rdp->dynticks_snap = atomic_add_return(0, &rdp->dyn...
c4f3060843506ba6d473ab9a0afe5bd5dc93a00d
Analyze and fix the following issue in the Linux kernel code: sched: Add is_idle_task() to handle invalidated uses of idle_cpu()
Problem Details: Commit 908a3283 (Fix idle_cpu()) invalidated some uses of idle_cpu(), which used to say whether or not the CPU was running the idle task, but now instead says whether or not the CPU is running the idle task in the absence of pending wakeups. Although this new implementation gives a better answer to th...
```diff diff --git a/include/linux/sched.h b/include/linux/sched.h index 1c4f3e9b9bc5..4a7e4d333a27 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -2070,6 +2070,14 @@ extern int sched_setscheduler(struct task_struct *, int, extern int sched_setscheduler_nocheck(struct task_struct *, int, ...
11dbaa8cb79a6e4a234a134898436f717a663f01
Analyze and fix the following issue in the Linux kernel code: rcu: Fix idle-task checks
Problem Details: RCU has traditionally relied on idle_cpu() to determine whether a given CPU is running in the context of an idle task, but commit 908a3283 (Fix idle_cpu()) has invalidated this approach. After commit 908a3283, idle_cpu() will return true if the current CPU is currently running the idle task, and will ...
```diff diff --git a/kernel/rcutiny.c b/kernel/rcutiny.c index 6d70ff71a875..4e16ce36fa03 100644 --- a/kernel/rcutiny.c +++ b/kernel/rcutiny.c @@ -64,7 +64,7 @@ static void rcu_idle_enter_common(long long oldval) return; } RCU_TRACE(trace_rcu_dyntick("Start", oldval, rcu_dynticks_nesting)); - if (!idle_cpu(smp_p...
9ceae0e248fb553c702d51d5275167d462f4efd2
Analyze and fix the following issue in the Linux kernel code: rcu: Add documentation for raw SRCU read-side primitives
Problem Details: Update various files in Documentation/RCU to reflect srcu_read_lock_raw() and srcu_read_unlock_raw(). Credit to Peter Zijlstra for suggesting use of the existing _raw suffix instead of the earlier bulkref names. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
```diff diff --git a/Documentation/RCU/checklist.txt b/Documentation/RCU/checklist.txt index 0c134f8afc6f..bff2d8be1e18 100644 --- a/Documentation/RCU/checklist.txt +++ b/Documentation/RCU/checklist.txt @@ -328,6 +328,12 @@ over a rather long period of time, but improvements are always welcome! RCU rather than SRCU, ...
0c53dd8b31404c1d7fd15be8f065ebaec615a562
Analyze and fix the following issue in the Linux kernel code: rcu: Introduce raw SRCU read-side primitives
Problem Details: The RCU implementations, including SRCU, are designed to be used in a lock-like fashion, so that the read-side lock and unlock primitives must execute in the same context for any given read-side critical section. This constraint is enforced by lockdep-RCU. However, there is a need to enter an SRCU rea...
```diff diff --git a/include/linux/srcu.h b/include/linux/srcu.h index d4b12443b2ef..1eb520cd1680 100644 --- a/include/linux/srcu.h +++ b/include/linux/srcu.h @@ -181,4 +181,47 @@ static inline void srcu_read_unlock(struct srcu_struct *sp, int idx) __srcu_read_unlock(sp, idx); } +/** + * srcu_read_lock_raw - regis...
416eb33cd60ef405e2860a186364e57bcb2d89f6
Analyze and fix the following issue in the Linux kernel code: rcu: Fix early call to rcu_idle_enter()
Problem Details: On the irq exit path, tick_nohz_irq_exit() may raise a softirq, which action leads to the wake up path and select_task_rq_fair() that makes use of rcu to iterate the domains. This is an illegal use of RCU because we may be in RCU extended quiescent state if we interrupted an RCU-idle window in the idl...
```diff diff --git a/kernel/softirq.c b/kernel/softirq.c index f9f2aa81ce53..4eb3a0fa351e 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c @@ -347,12 +347,12 @@ void irq_exit(void) if (!in_interrupt() && local_softirq_pending()) invoke_softirq(); - rcu_irq_exit(); #ifdef CONFIG_NO_HZ /* Make sure that tim...
e37e112de3ac64032df45c2db0dbe1e8f1af86b4
Analyze and fix the following issue in the Linux kernel code: x86: Enter rcu extended qs after idle notifier call
Problem Details: The idle notifier, called by enter_idle(), enters into rcu read side critical section but at that time we already switched into the RCU-idle window (rcu_idle_enter() has been called). And it's illegal to use rcu_read_lock() in that state. This results in rcu reporting its bad mood: [ 1.275635] WAR...
```diff diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c index 18e8cf3581f6..64e926c89a6f 100644 --- a/arch/x86/kernel/process_64.c +++ b/arch/x86/kernel/process_64.c @@ -122,7 +122,7 @@ void cpu_idle(void) /* endless idle loop with no priority at all */ while (1) { - tick_nohz_idle_enter...
280f06774afedf849f0b34248ed6aff57d0f6908
Analyze and fix the following issue in the Linux kernel code: nohz: Separate out irq exit and idle loop dyntick logic
Problem Details: The tick_nohz_stop_sched_tick() function, which tries to delay the next timer tick as long as possible, can be called from two places: - From the idle loop to start the dytick idle mode - From interrupt exit if we have interrupted the dyntick idle mode, so that we reprogram the next tick event in case...
```diff diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c index 3d0c6fb74ae4..3f1f8daf703c 100644 --- a/arch/arm/kernel/process.c +++ b/arch/arm/kernel/process.c @@ -183,7 +183,7 @@ void cpu_idle(void) /* endless idle loop with no priority at all */ while (1) { - tick_nohz_stop_sched_tick(1); + ...
2c01531f08f8ba663a20d8472a3032f6df133b6e
Analyze and fix the following issue in the Linux kernel code: rcu: Document failing tick as cause of RCU CPU stall warning
Problem Details: One of lclaudio's systems was seeing RCU CPU stall warnings from idle. These turned out to be caused by a bug that stopped scheduling-clock tick interrupts from being sent to a given CPU for several hundred seconds. This commit therefore updates the documentation to call this out as a possible cause fo...
```diff diff --git a/Documentation/RCU/stallwarn.txt b/Documentation/RCU/stallwarn.txt index 4e959208f736..f3e0625f4290 100644 --- a/Documentation/RCU/stallwarn.txt +++ b/Documentation/RCU/stallwarn.txt @@ -101,6 +101,11 @@ o A CPU-bound real-time task in a CONFIG_PREEMPT_RT kernel that CONFIG_TREE_PREEMPT_RCU case, ...
9b2e4f1880b789be1f24f9684f7a54b90310b5c0
Analyze and fix the following issue in the Linux kernel code: rcu: Track idleness independent of idle tasks
Problem Details: Earlier versions of RCU used the scheduling-clock tick to detect idleness by checking for the idle task, but handled idleness differently for CONFIG_NO_HZ=y. But there are now a number of uses of RCU read-side critical sections in the idle task, for example, for tracing. A more fine-grained detection...
```diff diff --git a/Documentation/RCU/trace.txt b/Documentation/RCU/trace.txt index aaf65f6c6cd7..49587abfc2f7 100644 --- a/Documentation/RCU/trace.txt +++ b/Documentation/RCU/trace.txt @@ -105,14 +105,10 @@ o "dt" is the current value of the dyntick counter that is incremented or one greater than the interrupt-nest...
56a8b9f181b5e9b201ab02ad0b63ccdc17d4b191
Analyze and fix the following issue in the Linux kernel code: [media] tm6000: Fix a warning at tm6000_ir_int_start()
Problem Details: drivers/media/video/tm6000/tm6000-input.c: In function ‘tm6000_ir_int_start’: drivers/media/video/tm6000/tm6000-input.c:381:3: warning: ‘return’ with no value, in function returning non-void [-Wreturn-type] Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/video/tm6000/tm6000-input.c b/drivers/media/video/tm6000/tm6000-input.c index 89e003c0cfed..8d925274c8d6 100644 --- a/drivers/media/video/tm6000/tm6000-input.c +++ b/drivers/media/video/tm6000/tm6000-input.c @@ -378,7 +378,7 @@ int tm6000_ir_int_start(struct tm6000_core *dev) struct...
393a23fc9377ac3deaa97c5cc00b5c78746c8570
Analyze and fix the following issue in the Linux kernel code: [media] s5p-fimc: Fix camera input configuration in subdev operations
Problem Details: When using only subdev user-space operations the camera interface input was not configured properly. Fix this by updating the corresponding data structure in set_fmt operation. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-of...
```diff diff --git a/drivers/media/video/s5p-fimc/fimc-capture.c b/drivers/media/video/s5p-fimc/fimc-capture.c index 82d9ab6984eb..2cc3b9166724 100644 --- a/drivers/media/video/s5p-fimc/fimc-capture.c +++ b/drivers/media/video/s5p-fimc/fimc-capture.c @@ -1242,6 +1242,7 @@ static int fimc_subdev_set_fmt(struct v4l2_subd...
a32390d808b5b7a6b1c7f9236673c917b4733f13
Analyze and fix the following issue in the Linux kernel code: [media] m5mols: Fix logic in sanity check
Problem Details: Detected by "cppcheck". Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/video/m5mols/m5mols_core.c b/drivers/media/video/m5mols/m5mols_core.c index 68497f8ddcd9..5da8d74df508 100644 --- a/drivers/media/video/m5mols/m5mols_core.c +++ b/drivers/media/video/m5mols/m5mols_core.c @@ -333,7 +333,7 @@ int m5mols_mode(struct m5mols_info *info, u8 mode) int ret ...
806e23e95f94a27ee445022d724060b9b45cb64a
Analyze and fix the following issue in the Linux kernel code: [media] uvcvideo: Fix integer overflow in uvc_ioctl_ctrl_map()
Problem Details: There is a potential integer overflow in uvc_ioctl_ctrl_map(). When a large xmap->menu_count is passed from the userspace, the subsequent call to kmalloc() will allocate a buffer smaller than expected. map->menu_count and map->menu_info would later be used in a loop (e.g. in uvc_query_v4l2_ctrl), which...
```diff diff --git a/drivers/media/video/uvc/uvc_v4l2.c b/drivers/media/video/uvc/uvc_v4l2.c index b1dc3e507fc1..2ae4f880ea05 100644 --- a/drivers/media/video/uvc/uvc_v4l2.c +++ b/drivers/media/video/uvc/uvc_v4l2.c @@ -58,6 +58,15 @@ static int uvc_ioctl_ctrl_map(struct uvc_video_chain *chain, break; case V4L2_C...
7bc5edb00bbd02449576289a50d2900f58e7187a
Analyze and fix the following issue in the Linux kernel code: [media] uvcvideo: Extract video stream statistics
Problem Details: Export the statistics through debugfs. Signed-off-by: Alexey Fisher <bug-track@fisher-privat.net> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/video/uvc/uvc_debugfs.c b/drivers/media/video/uvc/uvc_debugfs.c index 39fd43b3e1d2..14561a5abb79 100644 --- a/drivers/media/video/uvc/uvc_debugfs.c +++ b/drivers/media/video/uvc/uvc_debugfs.c @@ -18,6 +18,57 @@ #include "uvcvideo.h" +/* -------------------------------------------...
edbaa39842793fc4ac6603b277f2ad76f2057a45
Analyze and fix the following issue in the Linux kernel code: [media] uvcvideo: Add debugfs support
Problem Details: Create a debugfs entry per UVC stream. This will be used to export stream statistics. Signed-off-by: Alexey Fisher <bug-track@fisher-privat.net> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> [mchehab@redhat.com: add incude <linux/module.h> to avoid compilation breakage] Signed-of...
```diff diff --git a/drivers/media/video/uvc/Makefile b/drivers/media/video/uvc/Makefile index 2071ca8a2f03..c26d12fdb8f4 100644 --- a/drivers/media/video/uvc/Makefile +++ b/drivers/media/video/uvc/Makefile @@ -1,5 +1,5 @@ uvcvideo-objs := uvc_driver.o uvc_queue.o uvc_v4l2.o uvc_video.o uvc_ctrl.o \ - uvc_status.o...
5eefb4f09bd8b250421fbd055e67d136d57f4030
Analyze and fix the following issue in the Linux kernel code: [media] ati_remote: switch to single-byte scancodes
Problem Details: The ati_remote driver currently uses 2-byte scancodes. However, one of those bytes is actually a checksum and therefore shouldn't be considered as part of the scancode. Fix the driver to only use the actual data byte as a scancode and to check the checksum itself. Update the bundled keymaps accordingl...
```diff diff --git a/drivers/media/rc/ati_remote.c b/drivers/media/rc/ati_remote.c index 303f22ea04c0..01bb8daf4b09 100644 --- a/drivers/media/rc/ati_remote.c +++ b/drivers/media/rc/ati_remote.c @@ -189,7 +189,7 @@ struct ati_remote { dma_addr_t inbuf_dma; dma_addr_t outbuf_dma; - unsigned char old_data[2]; /* D...
4be9c8fb58e48cd0110bd9504b0af1e18fa54467
Analyze and fix the following issue in the Linux kernel code: [media] tm6000: Fix check for interrupt endpoint
Problem Details: Checking for &dev->int_in is useless because it returns the address of the embedded struct tm6000_endpoint, which will always be positive and therefore true. Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/video/tm6000/tm6000-input.c b/drivers/media/video/tm6000/tm6000-input.c index af4bcf5288a9..89e003c0cfed 100644 --- a/drivers/media/video/tm6000/tm6000-input.c +++ b/drivers/media/video/tm6000/tm6000-input.c @@ -426,7 +426,7 @@ int tm6000_ir_init(struct tm6000_core *dev) rc->scanmas...
875f0e3da1e88f166940cbb5e530b05eb64ccc1f
Analyze and fix the following issue in the Linux kernel code: [media] tm6000: Fix bad indentation
Problem Details: Function parameters on subsequent lines should never be aligned with the function name but rather be indented. Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/video/tm6000/tm6000-video.c b/drivers/media/video/tm6000/tm6000-video.c index 436fd67b71ae..7ce967bf01ec 100644 --- a/drivers/media/video/tm6000/tm6000-video.c +++ b/drivers/media/video/tm6000/tm6000-video.c @@ -1614,12 +1614,10 @@ static int tm6000_release(struct file *file) if ...
fcd44b9efb0b33208a8575e5e776f4319d3b9698
Analyze and fix the following issue in the Linux kernel code: [media] tm6000: Fix fast USB access quirk
Problem Details: The original patch used the fast USB quirk to enable fast access to registers in the tm6000_read_write_usb(). The applied patch moved the check to the tm6000_reset(), probably due to some merge conflicts. Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de> Signed-off-by: Mauro Carvalho Ch...
```diff diff --git a/drivers/media/video/tm6000/tm6000-core.c b/drivers/media/video/tm6000/tm6000-core.c index fa37b5fc7b2a..979c85b73814 100644 --- a/drivers/media/video/tm6000/tm6000-core.c +++ b/drivers/media/video/tm6000/tm6000-core.c @@ -88,7 +88,9 @@ int tm6000_read_write_usb(struct tm6000_core *dev, u8 req_type,...
6b806e30a3149816454a7ab71d50c244ebdb27d1
Analyze and fix the following issue in the Linux kernel code: [media] V4L: mt9m111: fix uninitialised mutex
Problem Details: Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/video/mt9m111.c b/drivers/media/video/mt9m111.c index f023cc092c2b..dda4685166d5 100644 --- a/drivers/media/video/mt9m111.c +++ b/drivers/media/video/mt9m111.c @@ -954,6 +954,7 @@ static int mt9m111_probe(struct i2c_client *client, mt9m111->rect.height = MT9M111_MAX_HEIGHT; mt9m11...
9c0223b53a26c506ecc7a36ec491afa688eebee1
Analyze and fix the following issue in the Linux kernel code: [media] V4L: omap1_camera: fix missing <linux/module.h> include
Problem Details: Otherwise compilation breaks with: ... after apparently no longer included recursively from other header files. Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/video/omap1_camera.c b/drivers/media/video/omap1_camera.c index e87ae2f634b2..6a6cf388bae4 100644 --- a/drivers/media/video/omap1_camera.c +++ b/drivers/media/video/omap1_camera.c @@ -24,6 +24,7 @@ #include <linux/clk.h> #include <linux/dma-mapping.h> #include <linux/interrupt.h> +...
4c0b036db808054f10f79e9a3d7928cf90aeb186
Analyze and fix the following issue in the Linux kernel code: [media] V4L: soc-camera: fix compiler warnings on 64-bit platforms
Problem Details: On 64-bit platforms assigning a pointer to a 32-bit variable causes a compiler warning and cannot actually work. Soc-camera currently doesn't support any 64-bit systems, but such platforms can be added in the and in any case compiler warnings should be avoided. Signed-off-by: Guennadi Liakhovetski <g....
```diff diff --git a/drivers/media/video/ov6650.c b/drivers/media/video/ov6650.c index d5b057207a7b..577941fa3831 100644 --- a/drivers/media/video/ov6650.c +++ b/drivers/media/video/ov6650.c @@ -539,7 +539,7 @@ static u8 to_clkrc(struct v4l2_fract *timeperframe, static int ov6650_s_fmt(struct v4l2_subdev *sd, struct v...
a626f3945208af1d60d3dccf064cac3b15bc54ca
Analyze and fix the following issue in the Linux kernel code: [media] s5p_mfc_enc: fix s/H264/H263/ typo
Problem Details: Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk> Aked-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/video/s5p-mfc/s5p_mfc_enc.c b/drivers/media/video/s5p-mfc/s5p_mfc_enc.c index 1e8cdb77d4b8..dff9dc798795 100644 --- a/drivers/media/video/s5p-mfc/s5p_mfc_enc.c +++ b/drivers/media/video/s5p-mfc/s5p_mfc_enc.c @@ -61,7 +61,7 @@ static struct s5p_mfc_fmt formats[] = { .num_planes = 1,...
d1ee8878a142f81ea1b40d602c6360b752829437
Analyze and fix the following issue in the Linux kernel code: [media] omap_vout: Fix compile error in 3.1
Problem Details: This patch is against the mainline v3.1 release (c3b92c8) and fixes a compile error when building for OMAP3+DSS+VOUT Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Gary Thomas <gary@mlbassoc.com> Cc: stable@kernel.org Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat....
```diff diff --git a/drivers/media/video/omap/omap_vout.c b/drivers/media/video/omap/omap_vout.c index 2d2a136e465e..ee0d0b39cd17 100644 --- a/drivers/media/video/omap/omap_vout.c +++ b/drivers/media/video/omap/omap_vout.c @@ -38,6 +38,7 @@ #include <linux/irq.h> #include <linux/videodev2.h> #include <linux/dma-mapp...