id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
8404877ee1cfdbc872e153fd89022f9e47f6f5a3
Analyze and fix the following issue in the Linux kernel code: xen/p2m/debugfs: Fix potential pointer exception.
Problem Details: We could be referencing the last + 1 element of level_name[] array which would cause a pointer exception, because of the initial setup of lvl=4. [v1: No need to do this for type_name, pointed out by Ian Campbell] Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
```diff diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c index 58efeb9d5440..2e3bf7a0732b 100644 --- a/arch/x86/xen/p2m.c +++ b/arch/x86/xen/p2m.c @@ -786,7 +786,7 @@ EXPORT_SYMBOL_GPL(m2p_find_override_pfn); int p2m_dump_show(struct seq_file *m, void *v) { static const char * const level_name[] = { "top", "mid...
5e287830136a8edb76e9f9c432b264d99833172f
Analyze and fix the following issue in the Linux kernel code: xen/enlighten: Fix compile warnings and set cx to known value.
Problem Details: We get: linux/arch/x86/xen/enlighten.c: In function ‘xen_start_kernel’: linux/arch/x86/xen/enlighten.c:226: warning: ‘cx’ may be used uninitialized in this function linux/arch/x86/xen/enlighten.c:240: note: ‘cx’ was declared here and the cx is really not set but passed in the xen_cpuid instruction whi...
```diff diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index 2d69617950f7..da8afd576a6b 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c @@ -251,6 +251,7 @@ static void __init xen_init_cpuid_mask(void) ~((1 << X86_FEATURE_APIC) | /* disable local APIC */ (1 << X86_FEATUR...
e6599225db36bbdc991d1cc8fbfcacb24f86cdb5
Analyze and fix the following issue in the Linux kernel code: xen/irq: If we fail during msi_capability_init return proper error code.
Problem Details: There are three different modes: PV, HVM, and initial domain 0. In all the cases we would return -1 for failure instead of a proper error code. Fix this by propagating the error code from the generic IRQ code. Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
```diff diff --git a/arch/x86/pci/xen.c b/arch/x86/pci/xen.c index 1017c7bee388..11a9301d52d4 100644 --- a/arch/x86/pci/xen.c +++ b/arch/x86/pci/xen.c @@ -175,8 +175,10 @@ static int xen_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) "pcifront-msi-x" : "pcifront-msi", DOMID_SEL...
9d093e2958baf76154d1008339f594f798a52790
Analyze and fix the following issue in the Linux kernel code: xen/events: BUG() when we can't allocate our event->irq array.
Problem Details: In case we can't allocate we are doomed. We should BUG_ON instead of trying to dereference it later on. Acked-by: Ian Campbell <ian.campbell@citrix.com> [v1: Use BUG_ON instead of BUG] Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
```diff diff --git a/drivers/xen/events.c b/drivers/xen/events.c index 7523719bf8a4..6b002cca1f5a 100644 --- a/drivers/xen/events.c +++ b/drivers/xen/events.c @@ -1670,6 +1670,7 @@ void __init xen_init_IRQ(void) evtchn_to_irq = kcalloc(NR_EVENT_CHANNELS, sizeof(*evtchn_to_irq), GFP_KERNEL); + BUG_ON(!evtch...
75bb23a2150e385230d1db52065641ca7cef63d3
Analyze and fix the following issue in the Linux kernel code: staging:iio:dac:ad5791: Fix scale unit
Problem Details: Scale is currently reported in volts instead of millivolts. This patch fixes it. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
```diff diff --git a/drivers/staging/iio/dac/ad5791.c b/drivers/staging/iio/dac/ad5791.c index 9ba45f1a2379..6fbca8d96153 100644 --- a/drivers/staging/iio/dac/ad5791.c +++ b/drivers/staging/iio/dac/ad5791.c @@ -239,7 +239,7 @@ static int ad5791_read_raw(struct iio_dev *indio_dev, return IIO_VAL_INT; case (1 << IIO...
9dc9961dca37379fd128508aac37e9f4928ee18f
Analyze and fix the following issue in the Linux kernel code: staging:iio:dac:ad5791: Allow asymmetrical reference voltages
Problem Details: The ad5791 currently assumes that the negative and positive supply have the same absolute value, which is not necessarily true. This patch introduces a offset attribute which will contain the negative supply voltage scaled according to the iio spec. The raw attribute now accepts values in the range of ...
```diff diff --git a/drivers/staging/iio/dac/ad5791.c b/drivers/staging/iio/dac/ad5791.c index 9a76c4311f9f..c465fcfdac46 100644 --- a/drivers/staging/iio/dac/ad5791.c +++ b/drivers/staging/iio/dac/ad5791.c @@ -77,7 +77,8 @@ static int ad5791_spi_read(struct spi_device *spi, u8 addr, u32 *val) .indexed = 1, \ ....
021c0a381c5c1ae457bb9316669736d2ec66f972
Analyze and fix the following issue in the Linux kernel code: staging:iio:dac:ad5791: Use correct DAC bit-size
Problem Details: Commit c5b99396 ("staging:iio:dac:ad5791 chan spec conversion.") introduced a small bug, using storagebits instead of realbits throughout the driver, which causes the driver to work incorrectly. This patch fixes it. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Jonathan Cameron <jic23@...
```diff diff --git a/drivers/staging/iio/dac/ad5791.c b/drivers/staging/iio/dac/ad5791.c index fbf446d56717..9a76c4311f9f 100644 --- a/drivers/staging/iio/dac/ad5791.c +++ b/drivers/staging/iio/dac/ad5791.c @@ -234,11 +234,11 @@ static int ad5791_read_raw(struct iio_dev *indio_dev, return ret; *val &= AD5791_DAC...
1b992320775691ba0124bd37c5fffe16172743cd
Analyze and fix the following issue in the Linux kernel code: iio: cdc: Fix pushed event code - Typo, should be IIO_CAPACITANCE.
Problem Details: Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
```diff diff --git a/drivers/staging/iio/cdc/ad7150.c b/drivers/staging/iio/cdc/ad7150.c index e185f0e052a3..a761ca94a17e 100644 --- a/drivers/staging/iio/cdc/ad7150.c +++ b/drivers/staging/iio/cdc/ad7150.c @@ -473,7 +473,7 @@ static irqreturn_t ad7150_event_handler(int irq, void *private) if ((int_status & AD7150_ST...
5c48cb9de1fb9702d5cfbf659840d02fb226b601
Analyze and fix the following issue in the Linux kernel code: iio: adc: Relocate Capacitance to Digital Converters (CDC) into own subdir
Problem Details: No functional changes. Fix Kconfig description. Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
```diff diff --git a/drivers/staging/iio/Kconfig b/drivers/staging/iio/Kconfig index 09cf5800c8ed..4ec9118955f9 100644 --- a/drivers/staging/iio/Kconfig +++ b/drivers/staging/iio/Kconfig @@ -59,6 +59,7 @@ config IIO_CONSUMERS_PER_TRIGGER source "drivers/staging/iio/accel/Kconfig" source "drivers/staging/iio/adc/Kconf...
e63abd0a1b757f6433869c13da4cf1b07fc14284
Analyze and fix the following issue in the Linux kernel code: iio: Spell fix - consistent use of Converter - no functional changes
Problem Details: Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
```diff diff --git a/drivers/staging/iio/adc/Kconfig b/drivers/staging/iio/adc/Kconfig index bfe91d77fe7c..13e93fb97a79 100644 --- a/drivers/staging/iio/adc/Kconfig +++ b/drivers/staging/iio/adc/Kconfig @@ -1,7 +1,7 @@ # # ADC drivers # -menu "Analog to digital convertors" +menu "Analog to digital converters" con...
a2c76b83fdd763c826f38a55127ccf25708099ce
Analyze and fix the following issue in the Linux kernel code: usb: renesas_usbhs: fixup inconsistent return from usbhs_pkt_push()
Problem Details: usbhs_pkt_push() had inconsistent return under spin lock. This patch fix it up. Special thanks to Dan Cc: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
```diff diff --git a/drivers/usb/renesas_usbhs/fifo.c b/drivers/usb/renesas_usbhs/fifo.c index 762b7429d8bb..8da685e796d1 100644 --- a/drivers/usb/renesas_usbhs/fifo.c +++ b/drivers/usb/renesas_usbhs/fifo.c @@ -62,14 +62,14 @@ void usbhs_pkt_push(struct usbhs_pipe *pipe, struct usbhs_pkt *pkt, struct device *dev = us...
d208a3bf77f902283894f546b6b5383202cf7882
Analyze and fix the following issue in the Linux kernel code: TTY: serial_core: Fix crash if DCD drop during suspend
Problem Details: This crash was showing up 100% of the time on Tegra CPUs when an agetty was running on the serial port and the console was not running on the serial port. The reason the Tegra saw it so reliably is that the Tegra CPU internally ties DTR to DCD/DSR. That means when we dropped DTR during suspend we wou...
```diff diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index e562b1224466..9f72be28e6f2 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -243,6 +243,13 @@ static void uart_shutdown(struct tty_struct *tty, struct uart_state *state) synchronize_i...
f06ac72e929115f2772c29727152ba0832d641e4
Analyze and fix the following issue in the Linux kernel code: cifs, freezer: add wait_event_freezekillable and have cifs use it
Problem Details: CIFS currently uses wait_event_killable to put tasks to sleep while they await replies from the server. That function though does not allow the freezer to run. In many cases, the network interface may be going down anyway, in which case the reply will never come. The client then ends up blocking the co...
```diff diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c index e7398d0cd054..0cc9584f5889 100644 --- a/fs/cifs/transport.c +++ b/fs/cifs/transport.c @@ -26,6 +26,7 @@ #include <linux/wait.h> #include <linux/net.h> #include <linux/delay.h> +#include <linux/freezer.h> #include <asm/uaccess.h> #include <asm/pro...
2ab2593f4b8953ff951f5531e695e487dfe0b51f
Analyze and fix the following issue in the Linux kernel code: cifs: fix protocol definition for READ_RSP
Problem Details: There is no pad, and it simplifies the code to remove the "Data" field. None of the existing code relies on these fields, or on the READ_RSP being a particular length. Reviewed-and-Tested-by: Pavel Shilovsky <piastry@etersoft.ru> Signed-off-by: Jeff Layton <jlayton@redhat.com>
```diff diff --git a/fs/cifs/cifspdu.h b/fs/cifs/cifspdu.h index de3aa285de03..3c6ef34fe2bc 100644 --- a/fs/cifs/cifspdu.h +++ b/fs/cifs/cifspdu.h @@ -1089,9 +1089,7 @@ typedef struct smb_com_read_rsp { __le16 DataLengthHigh; __u64 Reserved2; __u16 ByteCount; - __u8 Pad; /* BB check for whether padded to DWORD -...
7e355b83efa80e5f5821591c13c17649594d82ac
Analyze and fix the following issue in the Linux kernel code: Btrfs: if we have a lot of pinned space, commit the transaction
Problem Details: Mitch kept hitting a panic because he was getting ENOSPC. One of my previous patches makes it so we are much better at not allocating new metadata chunks. Unfortunately coupled with the overcommit patch this works us into a bit of a problem if we are removing a bunch of space and end up chewing up all...
```diff diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index a5f1421eeee9..4eb7d2ba38f8 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -3510,6 +3510,20 @@ again: u64 profile = btrfs_get_alloc_profile(root, 0); u64 avail; + /* + * If we have a lot of space that's pinned, don...
ed3ee9f44ba55eb6acfbfc8caa881e0253710d2a
Analyze and fix the following issue in the Linux kernel code: Btrfs: fix regression in re-setting a large xattr
Problem Details: Recently I changed the xattr stuff to unconditionally set the xattr first in case the xattr didn't exist yet. This has introduced a regression when setting an xattr that already exists with a large value. If we find the key we are looking for split_leaf will assume that we're extending that item. Th...
```diff diff --git a/fs/btrfs/xattr.c b/fs/btrfs/xattr.c index 69565e5fc6a0..a76e41c04b71 100644 --- a/fs/btrfs/xattr.c +++ b/fs/btrfs/xattr.c @@ -127,6 +127,17 @@ static int do_setxattr(struct btrfs_trans_handle *trans, again: ret = btrfs_insert_xattr_item(trans, root, path, btrfs_ino(inode), name, name_...
e70bea5fe0e3d6355fd95674eaff5aa5a32f0564
Analyze and fix the following issue in the Linux kernel code: Btrfs: fix the amount of space reserved for unlink
Problem Details: Our unlink reservations were a bit much, we were reserving 10 and I only count 8 possible items we're touching, so comment what we're reserving for and fix the count value. Thanks, Signed-off-by: Josef Bacik <josef@redhat.com>
```diff diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 246397d8478f..1f013c5c36aa 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -2758,7 +2758,16 @@ static struct btrfs_trans_handle *__unlink_start_trans(struct inode *dir, u64 ino = btrfs_ino(inode); u64 dir_ino = btrfs_ino(dir); - trans = btrfs_...
9a82ca659d8bfd99afc0e89bbde2202322df5755
Analyze and fix the following issue in the Linux kernel code: Btrfs: take overflow into account in reserving space
Problem Details: My overcommit stuff can be a little racy when we're filling up the disk with fs_mark and we overcommit into things that quickly get used up for data. So use num_bytes to see if we have enough available space so we're less likely to overcommit ourselves out of the ability to make reservations. Thanks,...
```diff diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index f9711a82fc54..f95e55083bdb 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -3521,7 +3521,7 @@ again: avail >>= 1; spin_unlock(&root->fs_info->free_chunk_lock); - if (used + orig_bytes < space_info->total_bytes + av...
f75b130e9bb361850787e156c79311adb84f551e
Analyze and fix the following issue in the Linux kernel code: Btrfs: don't skip writing out a empty block groups cache
Problem Details: I noticed a slight bug where we will not bother writing out the block group cache's space cache if it's space tree is empty. Since it could have a cluster or pinned extents that need to be written out this is just not a valid test. Thanks, Signed-off-by: Josef Bacik <josef@redhat.com>
```diff diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c index 0a8ccdbdd464..b81556ca75ea 100644 --- a/fs/btrfs/free-space-cache.c +++ b/fs/btrfs/free-space-cache.c @@ -575,10 +575,6 @@ int __btrfs_write_out_cache(struct btrfs_root *root, struct inode *inode, INIT_LIST_HEAD(&bitmap_list); - ...
ef3be45722317f8c2fb0e861065df0c3830ff9ac
Analyze and fix the following issue in the Linux kernel code: Btrfs: check unused against how much space we actually want
Problem Details: There is a bug that may lead to early ENOSPC in our reservation code. We've been checking against num_bytes which may be above and beyond what we want to actually reserve, which could give us a false ENOSPC. Fix this by making sure the unused space is above how much we want to reserve and not how muc...
```diff diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 5498bdacd4c3..fd65f6bc676c 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -3472,7 +3472,7 @@ again: */ if (unused <= space_info->total_bytes) { unused = space_info->total_bytes - unused; - if (unused >= num_bytes) {...
a8c9e5769718d47e87cce40c9b84cab421804797
Analyze and fix the following issue in the Linux kernel code: Btrfs: fix orphan cleanup regression
Problem Details: In fixing how we deal with bad inodes, we had a regression in the orphan cleanup code, since it expects to get a bad inode back. So fix it to deal with getting -ESTALE back by deleting the orphan item manually and moving on. Thanks, Reported-by: Simon Kirby <sim@hostway.ca> Signed-off-by: Josef Baci...
```diff diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 88e3956be57d..8005be176252 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -2285,37 +2285,35 @@ int btrfs_orphan_cleanup(struct btrfs_root *root) found_key.type = BTRFS_INODE_ITEM_KEY; found_key.offset = 0; inode = btrfs_iget(root->fs_info-...
3b16a4e3c355ee3c790473decfcf83d4faeb8ce0
Analyze and fix the following issue in the Linux kernel code: Btrfs: use the inode's mapping mask for allocating pages
Problem Details: Johannes pointed out we were allocating only kernel pages for doing writes, which is kind of a big deal if you are on 32bit and have more than a gig of ram. So fix our allocations to use the mapping's gfp but still clear __GFP_FS so we don't re-enter. Thanks, Reported-by: Johannes Weiner <jweiner@red...
```diff diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index a5faf8e33baa..47dea7118e0e 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@ -30,6 +30,7 @@ #include <linux/kobject.h> #include <trace/events/btrfs.h> #include <asm/kmap_types.h> +#include <linux/pagemap.h> #include "extent_io.h" #include "extent...
7ed49f187c82821e35f8869399bcf90822a74a23
Analyze and fix the following issue in the Linux kernel code: Btrfs: fix space leak when we fail to make an allocation
Problem Details: When changing back to using a spin_lock to protect the extent counters I decided that since we would only be dropping our original extent, it was ok to just drop the extent and return. However since somebody else could have come in and done a reservation, we need to do the normal song and dance to cle...
```diff diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index a71fcf506531..99ab5716baad 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -4025,16 +4025,24 @@ int btrfs_delalloc_reserve_metadata(struct inode *inode, u64 num_bytes) ret = reserve_metadata_bytes(NULL, root, block_rsv, t...
a9b5fcddce594a408a48d523087b5bb64ce82469
Analyze and fix the following issue in the Linux kernel code: Btrfs: fix call to btrfs_search_slot in free space cache
Problem Details: We are setting ins_len to 1 even tho we are just modifying an item that should be there already. This may cause the search stuff to split nodes on the way down needelessly. Set this to 0 since we aren't inserting anything. Thanks, Signed-off-by: Josef Bacik <josef@redhat.com>
```diff diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c index b0122e19db6b..701ef5951e3f 100644 --- a/fs/btrfs/free-space-cache.c +++ b/fs/btrfs/free-space-cache.c @@ -802,7 +802,7 @@ int __btrfs_write_out_cache(struct btrfs_root *root, struct inode *inode, key.offset = offset; key.type = 0; ...
4289a667a0d7c6b134898cac7bfbe950267c305c
Analyze and fix the following issue in the Linux kernel code: Btrfs: fix how we reserve space for deleting inodes
Problem Details: I converted btrfs_truncate to do sane reservations for truncate, but didn't convert btrfs_evict_inode. Basically we need to save the orphan_rsv for deleting the orphan item, and do normal reservations for our truncate. Thanks, Signed-off-by: Josef Bacik <josef@redhat.com>
```diff diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 6402a41b9023..fe3891e240b3 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -3527,6 +3527,8 @@ void btrfs_evict_inode(struct inode *inode) { struct btrfs_trans_handle *trans; struct btrfs_root *root = BTRFS_I(inode)->root; + struct btrfs_block_r...
830c4adbd04a79f806d4fa579546f36a71b727c1
Analyze and fix the following issue in the Linux kernel code: Btrfs: fix how we mount subvol=<whatever>
Problem Details: We've only been able to mount with subvol=<whatever> where whatever was a subvol within whatever root we had as the default. This allows us to mount -o subvol=path/to/subvol/you/want relative from the normal fs_tree root. Thanks, Signed-off-by: Josef Bacik <josef@redhat.com>
```diff diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 244fa46c50b8..934789f7fd33 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -40,6 +40,7 @@ #include <linux/magic.h> #include <linux/slab.h> #include <linux/cleancache.h> +#include <linux/mnt_namespace.h> #include "compat.h" #include "delayed-ino...
a8d86cd75b709a9c9402c46674ea188493c53901
Analyze and fix the following issue in the Linux kernel code: nfsd4: remove unneeded CLAIM_DELEGATE_CUR workaround
Problem Details: 0c12eaffdf09466f36a9ffe970dda8f4aeb6efc0 "nfsd: don't break lease on CLAIM_DELEGATE_CUR" was a temporary workaround for a problem fixed properly in the vfs layer by 778fc546f749c588aa2f6cd50215d2715c374252 "locks: fix tracking of inprogress lease breaks", so we can revert that change (but keeping some ...
```diff diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 3e1d4e08dfad..15e0db140403 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -2653,12 +2653,6 @@ static __be32 nfs4_get_vfs_file(struct svc_rqst *rqstp, struct nfs4_file *fp, int oflag = nfs4_access_to_omode(open->op_share_access); int...
51192de3b8df0c22d311df7299979a7618daf267
Analyze and fix the following issue in the Linux kernel code: perf script: Fix unknown feature comment
Problem Details: "perf script -v" emits: unknown feature 3, continuing... unknown feature 4, continuing... unknown feature 5, continuing... unknown feature 6, continuing... unknown feature 7, continuing... unknown feature 8, continuing... unknown feature 9, continuing... unknown feature 10, continuing... unknown featu...
```diff diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index 2143a32638c2..3724707425ea 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c @@ -1895,6 +1895,21 @@ static int perf_file_section__process(struct perf_file_section *section, if (perf_header__read_build_ids(ph, fd, sectio...
6afcb3b7393f5aa388a0d077c490ed411ab3cd27
Analyze and fix the following issue in the Linux kernel code: TOMOYO: Fix unused kernel config option.
Problem Details: CONFIG_SECURITY_TOMOYO_MAX_{ACCEPT_ENTRY,AUDIT_LOG} introduced by commit 0e4ae0e0 "TOMOYO: Make several options configurable." were by error not used. Reported-by: Paul Bolle <pebolle@tiscali.nl> Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Signed-off-by: James Morris <jmorris@name...
```diff diff --git a/security/tomoyo/common.c b/security/tomoyo/common.c index 365f3bddee79..96b7233a0df6 100644 --- a/security/tomoyo/common.c +++ b/security/tomoyo/common.c @@ -502,8 +502,10 @@ static struct tomoyo_profile *tomoyo_assign_profile TOMOYO_CONFIG_WANT_REJECT_LOG; memset(ptr->config, TOMOYO_CONFIG_...
881e23e56764808e7ab1ed73b5d8a6700042ea38
Analyze and fix the following issue in the Linux kernel code: x86, microcode: Correct microcode revision format
Problem Details: 506ed6b53e00 ("x86, intel: Output microcode revision in /proc/cpuinfo") added microcode revision format to /proc/cpuinfo and the MCE handler in decimal format but both AMD and Intel patch levels are handled as hex numbers. Fix it. Acked-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Borislav Petko...
```diff diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c index 8af6fa473233..ad8d8973a396 100644 --- a/arch/x86/kernel/cpu/mcheck/mce.c +++ b/arch/x86/kernel/cpu/mcheck/mce.c @@ -221,7 +221,7 @@ static void print_mce(struct mce *m) * Note this output is parsed by external tools and ol...
c9a929dde3913780b5c416f4bb9d9ed804f509ce
Analyze and fix the following issue in the Linux kernel code: block: fix request_queue lifetime handling by making blk_queue_cleanup() properly shutdown
Problem Details: request_queue is refcounted but actually depdends on lifetime management from the queue owner - on blk_cleanup_queue(), block layer expects that there's no request passing through request_queue and no new one will. This is fundamentally broken. The queue owner (e.g. SCSI layer) doesn't have a way to ...
```diff diff --git a/block/blk-core.c b/block/blk-core.c index 034cbb2024f0..7e1523521c70 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -349,11 +349,13 @@ EXPORT_SYMBOL(blk_put_queue); /** * blk_drain_queue - drain requests from request_queue * @q: queue to drain + * @drain_all: whether to drain all requ...
ece84241b93c4693bfe0a8ec9a043a16d216d0cd
Analyze and fix the following issue in the Linux kernel code: block: fix genhd refcounting in blkio_policy_parse_and_set()
Problem Details: blkio_policy_parse_and_set() calls blkio_check_dev_num() to check whether the given dev_t is valid. blkio_check_dev_num() uses get_gendisk() for verification but never puts the returned genhd leaking the reference. This patch collapses blkio_check_dev_num() into its caller and updates it such that th...
```diff diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index b596e54ddd71..d61ec5636ce0 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c @@ -768,25 +768,14 @@ static uint64_t blkio_get_stat(struct blkio_group *blkg, return disk_total; } -static int blkio_check_dev_num(dev_t dev) -{ - int part = 0; - ...
523e1d399ce0e23bec562abe2b2f8d297af81161
Analyze and fix the following issue in the Linux kernel code: block: make gendisk hold a reference to its queue
Problem Details: The following command sequence triggers an oops. # mount /dev/sdb1 /mnt # echo 1 > /sys/class/scsi_device/0\:0\:1\:0/device/delete # umount /mnt general protection fault: 0000 [#1] PREEMPT SMP CPU 2 Modules linked in: Pid: 791, comm: umount Not tainted 3.1.0-rc3-work+ #8 Bochs Bochs RIP: 0010:[...
```diff diff --git a/block/genhd.c b/block/genhd.c index e2f67902dd02..d261b73b9744 100644 --- a/block/genhd.c +++ b/block/genhd.c @@ -611,6 +611,12 @@ void add_disk(struct gendisk *disk) register_disk(disk); blk_register_queue(disk); + /* + * Take an extra ref on queue which will be put on disk_release() + * s...
dc56c5a862d1491dcdc561241371949cca6362e1
Analyze and fix the following issue in the Linux kernel code: ASoC: sgtl5000: Fix setting mic bias resistor
Problem Details: According to the datasheet: CHIP_MIC_CTRL 0x002A BITS[9:8] BIAS_RESISTOR 0x0 = Powerd off 0x1 = 2.0 kohm 0x2 = 4.0 kohm 0x3 = 8.0 kohm To set mic bias resistor, we need to update bits[9:8] of SGTL5000_CHIP_MIC_CTRL register. Signed-off-by: Axel Lin <axel.lin@gmail.com...
```diff diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c index 91130fbc6913..3637a62ddeb4 100644 --- a/sound/soc/codecs/sgtl5000.c +++ b/sound/soc/codecs/sgtl5000.c @@ -131,16 +131,13 @@ static int mic_bias_event(struct snd_soc_dapm_widget *w, case SND_SOC_DAPM_POST_PMU: /* change mic bias re...
56c09aa520ad488c35c580d6f6fb1821bb4317b8
Analyze and fix the following issue in the Linux kernel code: ASoC: sgtl5000: Fix define for SGTL5000_BIAS_R_MASK
Problem Details: According to the datasheet: CHIP_MIC_CTRL 0x002A BITS[9:8] BIAS_RESISTOR 0x0 = Powerd off 0x1 = 2.0 kohm 0x2 = 4.0 kohm 0x3 = 8.0 kohm Thus SGTL5000_BIAS_R_MASK should be defined as 0x0300 instead of 0x0200. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Wolfr...
```diff diff --git a/sound/soc/codecs/sgtl5000.h b/sound/soc/codecs/sgtl5000.h index eec3ab368f39..8a9f43534b79 100644 --- a/sound/soc/codecs/sgtl5000.h +++ b/sound/soc/codecs/sgtl5000.h @@ -280,7 +280,7 @@ /* * SGTL5000_CHIP_MIC_CTRL */ -#define SGTL5000_BIAS_R_MASK 0x0200 +#define SGTL5000_BIAS_R_MASK 0x0300...
e58fced201ad6e6cb673f07499919c3b20792d94
Analyze and fix the following issue in the Linux kernel code: [media] videodev: fix a NULL pointer dereference in v4l2_device_release()
Problem Details: The change in 8280b66 does not cover the case when v4l2_dev is already NULL, fix that. With a Kinect sensor, seen as an USB camera using GSPCA in this context, a NULL pointer dereference BUG can be triggered by just unplugging the device after the camera driver has been loaded. Signed-off-by: Antonio...
```diff diff --git a/drivers/media/video/v4l2-dev.c b/drivers/media/video/v4l2-dev.c index d72156517726..a5c9ed128b97 100644 --- a/drivers/media/video/v4l2-dev.c +++ b/drivers/media/video/v4l2-dev.c @@ -181,7 +181,7 @@ static void v4l2_device_release(struct device *cd) * TODO: In the long run all drivers that use v4...
4399c8bf2b9093696fa8160d79712e7346989c46
Analyze and fix the following issue in the Linux kernel code: intel-iommu: fix superpage support in pfn_to_dma_pte()
Problem Details: If target_level == 0, current code breaks out of the while-loop if SUPERPAGE bit is set. We should also break out if PTE is not present. If we don't do this, KVM calls to iommu_iova_to_phys() will cause pfn_to_dma_pte() to create mapping for 4KiB pages. Signed-off-by: Allen Kay <allen.m.kay@intel.com>...
```diff diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index e5883602cb35..a88f3cbb100b 100644 --- a/drivers/iommu/intel-iommu.c +++ b/drivers/iommu/intel-iommu.c @@ -306,6 +306,11 @@ static inline bool dma_pte_present(struct dma_pte *pte) return (pte->val & 3) != 0; } +static inline bool d...
292827cb164ad00cc7689a21283b1261c0b6daed
Analyze and fix the following issue in the Linux kernel code: intel-iommu: fix return value of iommu_unmap() API
Problem Details: iommu_unmap() API expects IOMMU drivers to return the actual page order of the address being unmapped. Previous code was just returning page order passed in from the caller. This patch fixes this problem. Signed-off-by: Allen Kay <allen.m.kay@intel.com> Signed-off-by: David Woodhouse <David.Woodhous...
```diff diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index 5565753d460a..237ef52c8c76 100644 --- a/drivers/iommu/intel-iommu.c +++ b/drivers/iommu/intel-iommu.c @@ -819,13 +819,14 @@ static struct dma_pte *dma_pfn_level_pte(struct dmar_domain *domain, } /* clear last level pte, a tlb flush...
4c2625db6f172114bcc4fd9e62f3c030c5fb4e4c
Analyze and fix the following issue in the Linux kernel code: [media] media: vb2: fix incorrect return value
Problem Details: This patch fixes incorrect return value. Errors should be returned as negative numbers. Reported-by: Tomasz Stanislawski <t.stanislaws@samsung.com> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/video/videobuf2-core.c b/drivers/media/video/videobuf2-core.c index 6687ac33726a..3f5c7a38e6e8 100644 --- a/drivers/media/video/videobuf2-core.c +++ b/drivers/media/video/videobuf2-core.c @@ -751,7 +751,7 @@ static int __qbuf_userptr(struct vb2_buffer *vb, struct v4l2_buffer *b) ...
5a6e8482a16e61250a9121fc9ec719ab0529e760
Analyze and fix the following issue in the Linux kernel code: drm/radeon/kms/atom: fix handling of FB scratch indices
Problem Details: FB scratch indices are dword indices, but we were treating them as byte indices. As such, we were getting the wrong FB scratch data for non-0 indices. Fix the indices and guard the indexing against indices larger than the scratch allocation. Fixes memory corruption on some boards if data was written...
```diff diff --git a/drivers/gpu/drm/radeon/atom.c b/drivers/gpu/drm/radeon/atom.c index e88c64417a8a..14cc88aaf3a7 100644 --- a/drivers/gpu/drm/radeon/atom.c +++ b/drivers/gpu/drm/radeon/atom.c @@ -277,7 +277,12 @@ static uint32_t atom_get_src_int(atom_exec_context *ctx, uint8_t attr, case ATOM_ARG_FB: idx = U8(*...
4ea2739ea89883ddf79980a8aa27d5e57093e464
Analyze and fix the following issue in the Linux kernel code: pptp: pptp_rcv_core() misses pskb_may_pull() call
Problem Details: e1000e uses paged frags, so any layer incorrectly pulling bytes from skb can trigger a BUG in skb_pull() [951.142737] [<ffffffff813d2f36>] skb_pull+0x15/0x17 [951.142737] [<ffffffffa0286824>] pptp_rcv_core+0x126/0x19a [pptp] [951.152725] [<ffffffff813d17c4>] sk_receive_skb+0x69/0x105 [951.163558] ...
```diff diff --git a/drivers/net/pptp.c b/drivers/net/pptp.c index 9c0403d0107c..89f829f5f725 100644 --- a/drivers/net/pptp.c +++ b/drivers/net/pptp.c @@ -307,11 +307,18 @@ static int pptp_rcv_core(struct sock *sk, struct sk_buff *skb) } header = (struct pptp_gre_header *)(skb->data); + headersize = sizeof(*head...
e72ebf5a578464204c8418d7d9b375333bb33161
Analyze and fix the following issue in the Linux kernel code: mlx4: Fix vlan table overflow
Problem Details: Prevent overflow when trying to register more Vlans then the Vlan table in HW is configured to. Need to take into acount that the first 2 entries are reserved. Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/drivers/net/ethernet/mellanox/mlx4/port.c b/drivers/net/ethernet/mellanox/mlx4/port.c index 609e0ec14cee..163a314c148f 100644 --- a/drivers/net/ethernet/mellanox/mlx4/port.c +++ b/drivers/net/ethernet/mellanox/mlx4/port.c @@ -65,7 +65,7 @@ void mlx4_init_vlan_table(struct mlx4_dev *dev, struct mlx4...
73033c987a8bd0b080509063bb7c130b8941ad73
Analyze and fix the following issue in the Linux kernel code: caif-hsi: Fix for wakeup condition problem
Problem Details: Under stressed conditions a race could happen when del_timer_sync() was called from softirq context at the same time when mod_timer_pending() for the same timer was called from the workqueue. This leaded to a state mismatch in the CAIF HSI driver and following unexpected link wakeup procedure. The fix...
```diff diff --git a/drivers/net/caif/caif_hsi.c b/drivers/net/caif/caif_hsi.c index 36da27b50114..82c4d6ca2d3f 100644 --- a/drivers/net/caif/caif_hsi.c +++ b/drivers/net/caif/caif_hsi.c @@ -551,7 +551,9 @@ static void cfhsi_rx_done_work(struct work_struct *work) return; /* Update inactivity timer if pending. */...
fe47f1250805438fa06580c9ce6d37bc4bc595d2
Analyze and fix the following issue in the Linux kernel code: caif-hsi: Fixing a race condition in the caif_hsi code
Problem Details: cfhsi->tx_state was not protected by a spin lock. TX soft-irq could interrupt cfhsi_tx_done_work work leading to inconsistent state of the driver. Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/drivers/net/caif/caif_hsi.c b/drivers/net/caif/caif_hsi.c index 193781389f73..36da27b50114 100644 --- a/drivers/net/caif/caif_hsi.c +++ b/drivers/net/caif/caif_hsi.c @@ -304,14 +304,22 @@ static void cfhsi_tx_done_work(struct work_struct *work) spin_unlock_bh(&cfhsi->lock); /* Create HSI fr...
94230febe47f82331f9493c4fd61085e2a6bf756
Analyze and fix the following issue in the Linux kernel code: caif-hsi: HSI Fix uninitialized data in HSI header
Problem Details: CAIF HSI header may be uninitialized and cause last message to be repeated if transmit size is ~86 bytes long. Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/drivers/net/caif/caif_hsi.c b/drivers/net/caif/caif_hsi.c index 2fcabba56087..193781389f73 100644 --- a/drivers/net/caif/caif_hsi.c +++ b/drivers/net/caif/caif_hsi.c @@ -178,6 +178,9 @@ static int cfhsi_tx_frm(struct cfhsi_desc *desc, struct cfhsi *cfhsi) if (!skb) return 0; + /* Clear offse...
8bae8bd6cb24eecad9fda3e125d36ab9c67d3fd7
Analyze and fix the following issue in the Linux kernel code: pptp: fix skb leak in pptp_xmit()
Problem Details: In case we cant transmit skb, we must free it Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> CC: Dmitry Kozlov <xeb@mail.ru> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/drivers/net/pptp.c b/drivers/net/pptp.c index eae542a7e987..9c0403d0107c 100644 --- a/drivers/net/pptp.c +++ b/drivers/net/pptp.c @@ -285,8 +285,10 @@ static int pptp_xmit(struct ppp_channel *chan, struct sk_buff *skb) ip_send_check(iph); ip_local_out(skb); + return 1; tx_error: + kfree_sk...
751e67ca2e2790e9b9b187557d5ba6f96b6c4a7e
Analyze and fix the following issue in the Linux kernel code: md.c: trivial comment fix
Problem Details: Trivial comment fix Signed-off-by: Chris Dunlop <chris@onthe.net.au> Signed-off-by: NeilBrown <neilb@suse.de>
```diff diff --git a/drivers/md/md.c b/drivers/md/md.c index e8d198da917c..266e82ebaf11 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -741,8 +741,8 @@ static void mddev_unlock(struct mddev * mddev) } else mutex_unlock(&mddev->reconfig_mutex); - /* was we've dropped the mutex we need a spinlock to - * ma...
4d97480b1806e883eb1c7889d4e7a87e936e06d9
Analyze and fix the following issue in the Linux kernel code: bonding: use local function pointer of bond->recv_probe in bond_handle_frame
Problem Details: The bond->recv_probe is called in bond_handle_frame() when a packet is received, but bond_close() sets it to NULL. So, a panic occurs when both functions work in parallel. Why this happen: After null pointer check of bond->recv_probe, an sk_buff is duplicated and bond->recv_probe is called in bond_han...
```diff diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 6d79b78cfc75..de3d351ccb6b 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -1435,6 +1435,8 @@ static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb) struct sk_buff *skb = *ps...
299b0767642a65f0c5446ab6d35e6df0daf43d33
Analyze and fix the following issue in the Linux kernel code: ipv6: Fix IPsec slowpath fragmentation problem
Problem Details: ip6_append_data() builds packets based on the mtu from dst_mtu(rt->dst.path). On IPsec the effective mtu is lower because we need to add the protocol headers and trailers later when we do the IPsec transformations. So after the IPsec transformations the packet might be too big, which leads to a slowpat...
```diff diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index 835c04b5239f..1e20b64e646c 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c @@ -1193,6 +1193,7 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to, struct sk_buff *skb; unsigned int maxfraglen, fragheaderlen;...
c113464d4351591de8791c0cadfc165836e5a725
Analyze and fix the following issue in the Linux kernel code: ipv6: Remove superfluous NULL pointer check in ipv6_local_rxpmtu
Problem Details: The pointer to mtu_info is taken from the common buffer of the skb, thus it can't be a NULL pointer. This patch removes this check on mtu_info. Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/net/ipv6/datagram.c b/net/ipv6/datagram.c index b46e9f88ce37..e2480691c220 100644 --- a/net/ipv6/datagram.c +++ b/net/ipv6/datagram.c @@ -297,10 +297,6 @@ void ipv6_local_rxpmtu(struct sock *sk, struct flowi6 *fl6, u32 mtu) ipv6_addr_copy(&iph->daddr, &fl6->daddr); mtu_info = IP6CBMTU(skb); -...
b340a207c5d81a0a33899e8ab3236a04dd8b48c3
Analyze and fix the following issue in the Linux kernel code: cs89x0: Move the driver into the Cirrus dir
Problem Details: The cs89x0 driver was initial placed in the apple/ when it should have been placed in the cirrus/. This resolves the issue by moving the dirver and fixing up the respective Kconfig(s) and Makefile(s). Thanks to Sascha for reporting the issue. -v2 Fix a config error that was introduced with v1 by rem...
```diff diff --git a/drivers/net/ethernet/apple/Kconfig b/drivers/net/ethernet/apple/Kconfig index 59d5c2630acb..a759d5483ab9 100644 --- a/drivers/net/ethernet/apple/Kconfig +++ b/drivers/net/ethernet/apple/Kconfig @@ -5,8 +5,7 @@ config NET_VENDOR_APPLE bool "Apple devices" default y - depends on (PPC_PMAC && PPC...
6230c9b4f8957c8938ee4cf2d03166d3c2dc89de
Analyze and fix the following issue in the Linux kernel code: bluetooth: Properly clone LSM attributes to newly created child connections
Problem Details: The Bluetooth stack has internal connection handlers for all of the various Bluetooth protocols, and unfortunately, they are currently lacking the LSM hooks found in the core network stack's connection handlers. I say unfortunately, because this can cause problems for users who have have an LSM enable...
```diff diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c index 61f1f623091d..e8292369cdcf 100644 --- a/net/bluetooth/l2cap_sock.c +++ b/net/bluetooth/l2cap_sock.c @@ -26,6 +26,8 @@ /* Bluetooth L2CAP sockets. */ +#include <linux/security.h> + #include <net/bluetooth/bluetooth.h> #include <net...
835acf5da239b91edb9f7ebe36516999e156e6ee
Analyze and fix the following issue in the Linux kernel code: l2tp: fix a potential skb leak in l2tp_xmit_skb()
Problem Details: l2tp_xmit_skb() can leak one skb if skb_cow_head() returns an error. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c index ad4ac2601a56..34b2ddeacb67 100644 --- a/net/l2tp/l2tp_core.c +++ b/net/l2tp/l2tp_core.c @@ -1045,8 +1045,10 @@ int l2tp_xmit_skb(struct l2tp_session *session, struct sk_buff *skb, int hdr_len headroom = NET_SKB_PAD + sizeof(struct iphdr) + uhle...
1ce5cce895309862d2c35d922816adebe094fe4a
Analyze and fix the following issue in the Linux kernel code: bridge: fix hang on removal of bridge via netlink
Problem Details: Need to cleanup bridge device timers and ports when being bridge device is being removed via netlink. This fixes the problem of observed when doing: ip link add br0 type bridge ip link set dev eth1 master br0 ip link set br0 up ip link del br0 which would cause br0 to hang in unregister_netdev be...
```diff diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c index e73815456adf..1d420f64ff27 100644 --- a/net/bridge/br_if.c +++ b/net/bridge/br_if.c @@ -161,9 +161,10 @@ static void del_nbp(struct net_bridge_port *p) call_rcu(&p->rcu, destroy_nbp_rcu); } -/* called with RTNL */ -static void del_br(struct net_bri...
1177c0efc04d032644895b8d757f55b433912596
Analyze and fix the following issue in the Linux kernel code: TTY: pty, release tty in all ptmx_open fail paths
Problem Details: Mistakenly, commit 64ba3dc3143d (tty: never hold BTM while getting tty_mutex) switched one fail path in ptmx_open to not free the newly allocated tty. Fix that by jumping to the appropriate place. And rename the labels so that it's clear what is going on there. Introduced-in: v2.6.36-rc2 Signed-off-b...
```diff diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c index 7613f95f2d6b..2feea63d497a 100644 --- a/drivers/tty/pty.c +++ b/drivers/tty/pty.c @@ -686,15 +686,15 @@ static int ptmx_open(struct inode *inode, struct file *filp) retval = devpts_pty_new(inode, tty->link); if (retval) - goto out1; + goto err_rel...
fa90e1c935472281de314e6d7c9a37db9cbc2e4e
Analyze and fix the following issue in the Linux kernel code: TTY: make tty_add_file non-failing
Problem Details: If tty_add_file fails at the point it is now, we have to revert all the changes we did to the tty. It means either decrease all refcounts if this was a tty reopen or delete the tty if it was newly allocated. There was a try to fix this in v3.0-rc2 using tty_release in 0259894c7 (TTY: fix fail path in ...
```diff diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c index 98b6e3bdb000..7613f95f2d6b 100644 --- a/drivers/tty/pty.c +++ b/drivers/tty/pty.c @@ -657,12 +657,18 @@ static int ptmx_open(struct inode *inode, struct file *filp) nonseekable_open(inode, filp); + retval = tty_alloc_file(filp); + if (retval) + ret...
c290f8358acaeffd8e0c551ddcc24d1206143376
Analyze and fix the following issue in the Linux kernel code: TTY: drop driver reference in tty_open fail path
Problem Details: When tty_driver_lookup_tty fails in tty_open, we forget to drop a reference to the tty driver. This was added by commit 4a2b5fddd5 (Move tty lookup/reopen to caller). Fix that by adding tty_driver_kref_put to the fail path. I will refactor the code later. This is for the ease of backporting to stable...
```diff diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c index 4ca4bcd28ff7..6913da8f202c 100644 --- a/drivers/tty/tty_io.c +++ b/drivers/tty/tty_io.c @@ -1873,6 +1873,7 @@ got_driver: if (IS_ERR(tty)) { tty_unlock(); mutex_unlock(&tty_mutex); + tty_driver_kref_put(driver); return PTR_ERR(tty);...
64d91cfaade2155ad048fe3b65238a052e29dde4
Analyze and fix the following issue in the Linux kernel code: 8250_pci: Fix kernel panic when pch_uart is disabled
Problem Details: Currently, ".setup" function is not set. As a result, when detecting our IOH's uart device without pch_uart, kernel panic occurs at the following of pciserial_init_ports(). for (i = 0; i < nr_ports; i++) { if (quirk->setup(priv, board, &serial_port, i)) break; So, this patch adds the ".setup" f...
```diff diff --git a/drivers/tty/serial/8250_pci.c b/drivers/tty/serial/8250_pci.c index a79caba96d12..1b449b759990 100644 --- a/drivers/tty/serial/8250_pci.c +++ b/drivers/tty/serial/8250_pci.c @@ -1591,51 +1591,61 @@ static struct pci_serial_quirk pci_serial_quirks[] __refdata = { .vendor = PCI_VENDOR_ID_I...
0f8fd43c42f2cc249943be76a4db0d058c16b6dc
Analyze and fix the following issue in the Linux kernel code: USB: gadget: midi: memory leak in f_midi_bind_config()
Problem Details: There is a small memory leak on the error paths. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
```diff diff --git a/drivers/usb/gadget/f_midi.c b/drivers/usb/gadget/f_midi.c index ef1bc7a174ef..67b222908cf9 100644 --- a/drivers/usb/gadget/f_midi.c +++ b/drivers/usb/gadget/f_midi.c @@ -951,7 +951,7 @@ int __init f_midi_bind_config(struct usb_configuration *c, struct gmidi_in_port *port = kzalloc(sizeof(*port),...
0889551267e7b6b4d27dc9f726f3d0cb0d976105
Analyze and fix the following issue in the Linux kernel code: USB: gadget: midi: fix range check in f_midi_out_open()
Problem Details: ! has higher precedence than >= and since neither 0 nor 1 are greater than 8 the condition is always false. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
```diff diff --git a/drivers/usb/gadget/f_midi.c b/drivers/usb/gadget/f_midi.c index 44858dc074d3..ef1bc7a174ef 100644 --- a/drivers/usb/gadget/f_midi.c +++ b/drivers/usb/gadget/f_midi.c @@ -644,7 +644,7 @@ static int f_midi_out_open(struct snd_rawmidi_substream *substream) { struct f_midi *midi = substream->rmidi->...
273d23574f9dacd9c63c80e7d63639a669aad441
Analyze and fix the following issue in the Linux kernel code: QE/FHCI: fixed the CONTROL bug
Problem Details: For USB CONTROL transaction, when the data length is zero, the IN package is needed to finish this transaction in status stage. Signed-off-by: Jerry Huang <r66093@freescale.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
```diff diff --git a/drivers/usb/host/fhci-sched.c b/drivers/usb/host/fhci-sched.c index a42ef380e917..2df851b4bc7c 100644 --- a/drivers/usb/host/fhci-sched.c +++ b/drivers/usb/host/fhci-sched.c @@ -1,7 +1,7 @@ /* * Freescale QUICC Engine USB Host Controller Driver * - * Copyright (c) Freescale Semicondutor, Inc. ...
3a6e7119a7779866b432a3abf443243b52eaad3d
Analyze and fix the following issue in the Linux kernel code: USB: Fix USB Kconfig dependency problem on 85xx/QoirQ platforms
Problem Details: For FSL PPC SoCs USB_ARCH_HAS_EHCI currently on depends on PPC_83xx. However that excludes support for USB on 85xx & QorIQ devices. Use FSL_SOC insted which will get us 83xx, 85xx, QorIQ, and 5xxx which all have the same USB IP on them. Signed-off-by: Xulei <B33228@freescale.com> Signed-off-by: Kumar...
```diff diff --git a/drivers/usb/Kconfig b/drivers/usb/Kconfig index 251279e756fa..4ac2750491de 100644 --- a/drivers/usb/Kconfig +++ b/drivers/usb/Kconfig @@ -60,7 +60,7 @@ config USB_ARCH_HAS_OHCI # some non-PCI hcds implement EHCI config USB_ARCH_HAS_EHCI boolean - default y if PPC_83xx + default y if FSL_SOC d...
68aa95d5d4de31c9348c1628ffa85c805305ebc5
Analyze and fix the following issue in the Linux kernel code: EHCI: workaround for MosChip controller bug
Problem Details: This patch (as1489) works around a hardware bug in MosChip EHCI controllers. Evidently when one of these controllers increments the frame-index register, it changes the three low-order bits (the microframe counter) before changing the higher order bits (the frame counter). If the register is read at ...
```diff diff --git a/drivers/usb/host/ehci-dbg.c b/drivers/usb/host/ehci-dbg.c index 9952505d2357..d6d74d2e09f4 100644 --- a/drivers/usb/host/ehci-dbg.c +++ b/drivers/usb/host/ehci-dbg.c @@ -821,7 +821,7 @@ static ssize_t fill_registers_buffer(struct debug_buffer *buf) next += temp; temp = scnprintf (next, size, ...
91960c2ef095c4b0744349e80a933921cbdcfd6e
Analyze and fix the following issue in the Linux kernel code: usb: gadget: file_storage: fix race on unloading
Problem Details: There is a race, reproduced rarely if you unload the module when host finishes mass storage device initialization (reading partition table and so on): fsg_unbind() code first closes lun files then waits for worker thread to finish its work, as the result the thread may operate on already closed device ...
```diff diff --git a/drivers/usb/gadget/file_storage.c b/drivers/usb/gadget/file_storage.c index 5779549d7dc6..3ac4f51cd0bb 100644 --- a/drivers/usb/gadget/file_storage.c +++ b/drivers/usb/gadget/file_storage.c @@ -3153,6 +3153,15 @@ static void /* __init_or_exit */ fsg_unbind(struct usb_gadget *gadget) DBG(fsg, "unb...
31901264511cf20c5ed33b8649a3ca9ce28df60b
Analyze and fix the following issue in the Linux kernel code: batman-adv: fix tt_local_reset_flags() function
Problem Details: Currently the counter of tt_local_entry structures (tt_local_num) is incremented each time the tt_local_reset_flags() is invoked causing the node to send wrong TT_REPONSE packets containing a copy of non-initialised memory thus corrupting other nodes global translation table and making higher level com...
```diff diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c index fb6931d00cd7..f599db9dbec1 100644 --- a/net/batman-adv/translation-table.c +++ b/net/batman-adv/translation-table.c @@ -1668,6 +1668,8 @@ static void tt_local_reset_flags(struct bat_priv *bat_priv, uint16_t flags) rcu_...
8f5d621543cb064d2989fc223d3c2bc61a43981e
Analyze and fix the following issue in the Linux kernel code: usb/isp1760: Let OF bindings depend on general CONFIG_OF instead of PPC_OF .
Problem Details: To be able to use the driver on other OF-aware architectures, too. And add necessary OF related #includes to fix compilation error. Signed-off-by: Joachim Foerster <joachim.foerster@missinglinkelectronics.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
```diff diff --git a/drivers/usb/host/isp1760-if.c b/drivers/usb/host/isp1760-if.c index d2f6b2dd7405..791792db6e12 100644 --- a/drivers/usb/host/isp1760-if.c +++ b/drivers/usb/host/isp1760-if.c @@ -17,16 +17,18 @@ #include "isp1760-hcd.h" -#ifdef CONFIG_PPC_OF +#ifdef CONFIG_OF #include <linux/of.h> #include <l...
a8b43c00ef06aec49b9fe0a5bad8a6a320e4d27b
Analyze and fix the following issue in the Linux kernel code: USB: Fix runtime wakeup on OHCI
Problem Details: At least some OHCI hardware (such as the MCP89) fails to flag any change in the host status register or the port status registers when receiving a remote wakeup while in D3 state. This results in the controller being resumed but no device state change being noticed, at which point the controller is put...
```diff diff --git a/drivers/usb/host/ohci-hub.c b/drivers/usb/host/ohci-hub.c index 9154615292db..2f00040fc408 100644 --- a/drivers/usb/host/ohci-hub.c +++ b/drivers/usb/host/ohci-hub.c @@ -356,10 +356,7 @@ static void ohci_finish_controller_resume(struct usb_hcd *hcd) msleep(20); } - /* Does the root hub have ...
2900b33999e2fc8a8edf0dddaafffec4da25ee10
Analyze and fix the following issue in the Linux kernel code: xfs: put in missed fix for merge problem
Problem Details: I intended to do this as part of fixing part of the conflict with the merge with Linus' tree, but evidently it didn't get included in the commit. Signed-off-by: Alex Elder <aelder@sgi.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
```diff diff --git a/fs/xfs/xfs_trans_ail.c b/fs/xfs/xfs_trans_ail.c index 512ff646d01c..4e3f9bbe0141 100644 --- a/fs/xfs/xfs_trans_ail.c +++ b/fs/xfs/xfs_trans_ail.c @@ -434,7 +434,7 @@ xfsaild_push( if (!IOP_PUSHBUF(lip)) { stuck++; - flush_log = 1; + ailp->xa_log_flush++; } else { ailp->xa_...
0feefd97861f9b38accf09a12f8d323f2705e917
Analyze and fix the following issue in the Linux kernel code: dynamic_debug: fix undefined reference to `__netdev_printk'
Problem Details: Dynamic debug recently added support for netdev_printk. It uses __netdev_printk() to support this functionality. However, when CONFIG_NET is not set, we get the following error: lib/built-in.o: In function `__dynamic_netdev_dbg': (.text+0x9fda): undefined reference to `__netdev_printk' Fix this by ...
```diff diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index edec78052333..cb4b74548a3d 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -503,6 +503,8 @@ int __dynamic_dev_dbg(struct _ddebug *descriptor, } EXPORT_SYMBOL(__dynamic_dev_dbg); +#ifdef CONFIG_NET + int __dynamic_netdev_dbg(struct _...
431625dac14de7152235f2f9934d70a9b0f9df83
Analyze and fix the following issue in the Linux kernel code: dynamic_debug: use a single printk() to emit messages
Problem Details: We were using KERN_CONT to combine messages with their prefix. However, KERN_CONT is not smp safe, in the sense that it can interleave messages. This interleaving can result in printks coming out at the wrong loglevel. With the high frequency of printks that dynamic debug can produce this is not desir...
```diff diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 198d2afe18ed..edec78052333 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -422,52 +422,60 @@ static int ddebug_exec_query(char *query_string) return 0; } -static int dynamic_emit_prefix(const struct _ddebug *descriptor) +#define PR...
bd22c01e845ad22a89ae25005b38d28e6690c27a
Analyze and fix the following issue in the Linux kernel code: dynamic_debug: remove num_enabled accounting
Problem Details: The num_enabled accounting isn't actually used anywhere - remove them. Signed-off-by: Jason Baron <jbaron@redhat.com> Cc: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Andrew Morton <akpm@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
```diff diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index ee3b9ba625c5..198d2afe18ed 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -42,7 +42,6 @@ struct ddebug_table { struct list_head link; char *mod_name; unsigned int num_ddebugs; - unsigned int num_enabled; struct _ddebug *ddebugs;...
07613b0b5ef8570033aa806d1731dce599862223
Analyze and fix the following issue in the Linux kernel code: dynamic_debug: consolidate repetitive struct _ddebug descriptor definitions
Problem Details: Replace the repetitive struct _ddebug descriptor definitions with a new DECLARE_DYNAMIC_DEBUG_META_DATA(name, fmt) macro. [akpm@linux-foundation.org: s/DECLARE/DEFINE/] Signed-off-by: Jason Baron <jbaron@redhat.com> Cc: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Andrew Morton <akpm@google.com> Signe...
```diff diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index feaac1ee3001..13aae8087b56 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -54,35 +54,41 @@ extern int __dynamic_netdev_dbg(struct _ddebug *descriptor, const char *fmt, ...) __attribute_...
fe353178653b15add8626f5474842601be160281
Analyze and fix the following issue in the Linux kernel code: tools, slub: Fix off-by-one buffer corruption after readlink() call
Problem Details: readlink() never zero terminates the provided buffer. Therefore we already do buffer[count] = 0; This leads to an off-by-one buffer corruption as readlink() might return the full size of the buffer. The common technique is to reduce the buffer size by one. Another fix would be to check if (co...
```diff diff --git a/tools/slub/slabinfo.c b/tools/slub/slabinfo.c index 868cc93f7ac2..cc1a378f9c06 100644 --- a/tools/slub/slabinfo.c +++ b/tools/slub/slabinfo.c @@ -1145,7 +1145,7 @@ static void read_slab_dir(void) switch (de->d_type) { case DT_LNK: alias->name = strdup(de->d_name); - count = readlink(...
d77385f23830ee6c400569bac8b37e6eb3b7d360
Analyze and fix the following issue in the Linux kernel code: SUNRPC: Fix rpc_sockaddr2uaddr
Problem Details: rpc_sockaddr2uaddr is only used by net/sunrpc/rpcb_clnt.c, where it is used in a non-blockable context in at least one case. Add non-blocking capability by adding a gfp_t argument Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
```diff diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h index db7bcaf7c5bd..d926fd1a5313 100644 --- a/include/linux/sunrpc/clnt.h +++ b/include/linux/sunrpc/clnt.h @@ -9,6 +9,7 @@ #ifndef _LINUX_SUNRPC_CLNT_H #define _LINUX_SUNRPC_CLNT_H +#include <linux/types.h> #include <linux/socket.h> #...
45402c38eec740f52422aafc92937c6a4a8c8c0e
Analyze and fix the following issue in the Linux kernel code: nfs/super.c: local functions should be static
Problem Details: commit ae50c0b5 "pnfs: client stats" added additional information to the output of /proc/self/mountstats. The new functions introduced are only used in this file and should be marked static. If CONFIG_NFS_V4_1 is not defined, empty stub functions are used. If CONFIG_NFS_V4 is not defined these stub f...
```diff diff --git a/fs/nfs/super.c b/fs/nfs/super.c index 5b19b6aabe18..480b3b6bf71e 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c @@ -733,18 +733,22 @@ static int nfs_show_options(struct seq_file *m, struct vfsmount *mnt) return 0; } + +#ifdef CONFIG_NFS_V4 #ifdef CONFIG_NFS_V4_1 -void show_sessions(struct s...
7542274519b3ba87555410c66e8356ac1e3bc9b3
Analyze and fix the following issue in the Linux kernel code: pnfsblock: fix writeback deadlock
Problem Details: We should check if the sector is already initialized before trying to grab the page from page cache. Otherwise when two pages of the same block are written back by two threads each calling from writepage_locked, it can cause deadlock like bellow. [ 1080.972099] INFO: task kswapd0:25 blocked for more ...
```diff diff --git a/fs/nfs/blocklayout/blocklayout.c b/fs/nfs/blocklayout/blocklayout.c index 4ddbfbf1c3ad..281ae95932c9 100644 --- a/fs/nfs/blocklayout/blocklayout.c +++ b/fs/nfs/blocklayout/blocklayout.c @@ -533,6 +533,11 @@ bl_write_pagelist(struct nfs_write_data *wdata, int sync) fill_invalid_ext: dprintk("%s ...
e6d05a757c314ad88d0649d3835a8a1daa964236
Analyze and fix the following issue in the Linux kernel code: pnfsblock: fix NULL pointer dereference
Problem Details: bl_add_page_to_bio returns error pointer. bio should be reset to NULL in failure cases as the out path always calls bl_submit_bio. Signed-off-by: Peng Tao <peng_tao@emc.com> Signed-off-by: Jim Rees <rees@umich.edu> Cc: stable@kernel.org [3.0] Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
```diff diff --git a/fs/nfs/blocklayout/blocklayout.c b/fs/nfs/blocklayout/blocklayout.c index 2167ba2afdbb..4ddbfbf1c3ad 100644 --- a/fs/nfs/blocklayout/blocklayout.c +++ b/fs/nfs/blocklayout/blocklayout.c @@ -292,6 +292,7 @@ bl_read_pagelist(struct nfs_read_data *rdata) bl_end_io_read, par); if (IS_ERR(bi...
fdc17abbc4b6094b34ee8ff5d91eaba8637594a2
Analyze and fix the following issue in the Linux kernel code: pnfsblock: fix size of upcall message
Problem Details: Make the status field explicitly 32 bits. "...it's unlikely that the kernel and userspace would differ on the size of an int here, but it might be a good idea to go ahead and make that explicitly 32 bits in case we end up dealing with more exotic arches at some point in the future." Suggested-by: Jef...
```diff diff --git a/fs/nfs/blocklayout/blocklayout.h b/fs/nfs/blocklayout/blocklayout.h index f27d827960a3..58dc256402e3 100644 --- a/fs/nfs/blocklayout/blocklayout.h +++ b/fs/nfs/blocklayout/blocklayout.h @@ -150,7 +150,7 @@ BLK_LSEG2EXT(struct pnfs_layout_segment *lseg) } struct bl_dev_msg { - int status; + int3...
516f2e24faa7548a61d9ba790958528469c2e284
Analyze and fix the following issue in the Linux kernel code: pnfsblock: fix return code confusion
Problem Details: Always return PTR_ERR, not NULL, from nfs4_blk_get_deviceinfo and nfs4_blk_decode_device. Check for IS_ERR, not NULL, in bl_set_layoutdriver when calling nfs4_blk_get_deviceinfo. Signed-off-by: Jim Rees <rees@umich.edu> Signed-off-by: Benny Halevy <bhalevy@tonian.com> Cc: stable@kernel.org [3.0] Sign...
```diff diff --git a/fs/nfs/blocklayout/blocklayout.c b/fs/nfs/blocklayout/blocklayout.c index 9561c8fc8bdb..d2432f0dc40c 100644 --- a/fs/nfs/blocklayout/blocklayout.c +++ b/fs/nfs/blocklayout/blocklayout.c @@ -805,7 +805,7 @@ nfs4_blk_get_deviceinfo(struct nfs_server *server, const struct nfs_fh *fh, struct nfs4_d...
2da956523526e440ef4f4dd174e26f5ac06fe011
Analyze and fix the following issue in the Linux kernel code: nfs: don't try to migrate pages with active requests
Problem Details: nfs_find_and_lock_request will take a reference to the nfs_page and will then put it if the req is already locked. It's possible though that the reference will be the last one. That put then can kick off a whole series of reference puts: nfs_page nfs_open_context dentry inode If th...
```diff diff --git a/fs/nfs/write.c b/fs/nfs/write.c index 46aa4389ce13..72813ede029e 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c @@ -1691,34 +1691,20 @@ out_error: int nfs_migrate_page(struct address_space *mapping, struct page *newpage, struct page *page) { - struct nfs_page *req; - int ret; + /* + * If Pa...
b9dd3abbbc708da5e3c53424a5b2c66ab580f97e
Analyze and fix the following issue in the Linux kernel code: nfs: fix bug about IPv6 address scope checking
Problem Details: The result from ipv6_addr_scope() always not be a single SCOPE, so we can't use equal to compare the result with IPV6_ADDR_SCOPE_LINKLOCAL at nfs_sockaddr_match_ipaddr6. This patch fixs the problem, and lets checking address before scope_id. Signed-off-by: Mi Jinlong <mijinlong@cn.fujitsu.com> Signed...
```diff diff --git a/fs/nfs/client.c b/fs/nfs/client.c index 5833fbbf59b0..b4e41dd4d0f6 100644 --- a/fs/nfs/client.c +++ b/fs/nfs/client.c @@ -336,11 +336,12 @@ static int nfs_sockaddr_match_ipaddr6(const struct sockaddr *sa1, const struct sockaddr_in6 *sin1 = (const struct sockaddr_in6 *)sa1; const struct sockaddr...
3236c3e1adc0c7ec83eaff1de2d06746b7c5bb28
Analyze and fix the following issue in the Linux kernel code: nfs: don't redirty inode when ncommit == 0 in nfs_commit_unstable_pages
Problem Details: commit 420e3646 allowed the kernel to reduce the number of unnecessary commit calls by skipping the commit when there are a large number of outstanding pages. However, the current test in nfs_commit_unstable_pages does not handle the edge condition properly. When ncommit == 0, then that means that the...
```diff diff --git a/fs/nfs/write.c b/fs/nfs/write.c index 71296cc97f98..46aa4389ce13 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c @@ -1554,6 +1554,10 @@ static int nfs_commit_unstable_pages(struct inode *inode, struct writeback_contr int flags = FLUSH_SYNC; int ret = 0; + /* no commits means nothing needs to...
59b7c05fffba030e5d9e72324691e2f99aa69b79
Analyze and fix the following issue in the Linux kernel code: Revert "NFS: Ensure that writeback_single_inode() calls write_inode() when syncing"
Problem Details: This reverts commit b80c3cb628f0ebc241b02e38dd028969fb8026a2. The reverted commit was rendered obsolete by a VFS fix: commit 5547e8aac6f71505d621a612de2fca0dd988b439 (writeback: Update dirty flags in two steps). We now no longer need to worry about writeback_single_inode() missing our marking the inod...
```diff diff --git a/fs/nfs/write.c b/fs/nfs/write.c index c9bd2a6b7d4b..71296cc97f98 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c @@ -428,7 +428,6 @@ static void nfs_mark_request_dirty(struct nfs_page *req) { __set_page_dirty_nobuffers(req->wb_page); - __mark_inode_dirty(req->wb_page->mapping->host, I_DIRTY_DA...
d86b2b61d4dea614d6f319772a90a8f98b55ed67
Analyze and fix the following issue in the Linux kernel code: Smack: fix: invalid length set for the result of /smack/access
Problem Details: Forgot to update simple_transaction_set() to take terminator character into account. Signed-off-by: Jarkko Sakkinen <jarkko.j.sakkinen@gmail.com> Signed-off-by: Casey Schaufler <cschaufler@cschaufler-intel.(none)>
```diff diff --git a/security/smack/smackfs.c b/security/smack/smackfs.c index 5498c4a2d1ae..381eecffe516 100644 --- a/security/smack/smackfs.c +++ b/security/smack/smackfs.c @@ -1514,7 +1514,7 @@ static ssize_t smk_write_access(struct file *file, const char __user *buf, data[0] = res == 0 ? '1' : '0'; data[1] = '\...
ad4778fb40994dd7c779069dad6ff704d75b81e6
Analyze and fix the following issue in the Linux kernel code: CIFS: fix automount for DFS shares
Problem Details: Automounting directories are now invalidated by .d_revalidate() so to be d_instantiate()d again with the right DCACHE_NEED_AUTOMOUNT flag Reviewed-by: Jeff Layton <jlayton@samba.org> Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com> Signed-off-by: Steve French <smfrench@gmail.com>
```diff diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c index 0c8098d54d2b..d7eeb9d3ed6f 100644 --- a/fs/cifs/dir.c +++ b/fs/cifs/dir.c @@ -648,8 +648,16 @@ cifs_d_revalidate(struct dentry *direntry, struct nameidata *nd) if (direntry->d_inode) { if (cifs_revalidate_dentry(direntry)) return 0; - else + else { + ...
ee90d57e20bd4749dda3b14397392b18b89dc3ef
Analyze and fix the following issue in the Linux kernel code: ext4: quiet sparse noise about plain integer as NULL pointer
Problem Details: The third parameter to ext4_free_blocks is a struct buffer_head *. This parameter should be NULL not 0. This quiets the sparse noise: warning: Using plain integer as NULL pointer Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
```diff diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index 5c4861210d4c..2fc6cc0a51ca 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c @@ -2291,7 +2291,7 @@ static int ext4_remove_blocks(handle_t *handle, struct inode *inode, start = ext4_ext_pblock(ex); ext_debug("free first %u blocks starting %llu...
f6f96fdb8c2779f9bd8ed7b0b08405b4439c982b
Analyze and fix the following issue in the Linux kernel code: ext4: Fix comparison endianness problem in MMP initialization
Problem Details: As part of startup, the MMP initialization code does this: mmp->mmp_seq = seq = cpu_to_le32(mmp_new_seq()); Next, mmp->mmp_seq is written out to disk, a delay happens, and then the MMP block is read back in and the sequence value is tested: if (seq != le32_to_cpu(mmp->mmp_seq)) { /* fail the mount ...
```diff diff --git a/fs/ext4/mmp.c b/fs/ext4/mmp.c index 6b327423e622..7ea4ba4eff2a 100644 --- a/fs/ext4/mmp.c +++ b/fs/ext4/mmp.c @@ -296,7 +296,8 @@ skip: /* * write a new random sequence number. */ - mmp->mmp_seq = seq = cpu_to_le32(mmp_new_seq()); + seq = mmp_new_seq(); + mmp->mmp_seq = cpu_to_le32(seq); ...
bdfc230f33a9dab316dcb6be4696ae59e1562e3c
Analyze and fix the following issue in the Linux kernel code: ext4: MMP: fix error message rate-limiting logic in kmmpd
Problem Details: Current logic would print an error message only once, and then 'failed_writes' would stay at 1. Rework the loop to increment 'failed_writes' and print the error message every s_mmp_update_interval * 60 seconds, as intended according to the comment. Signed-off-by: Nikitas Angelinas <nikitas_angelinas@...
```diff diff --git a/fs/ext4/mmp.c b/fs/ext4/mmp.c index 2fca64efd6db..6b327423e622 100644 --- a/fs/ext4/mmp.c +++ b/fs/ext4/mmp.c @@ -125,8 +125,9 @@ static int kmmpd(void *data) * Don't spew too many error messages. Print one every * (s_mmp_update_interval * 60) seconds. */ - if (retval && (failed_writes...
a572e688cf5d99d2382016c7241ec37b523b0137
Analyze and fix the following issue in the Linux kernel code: firewire: ohci: fix isochronous DMA synchronization
Problem Details: Add the dma_sync_single_* calls necessary to ensure proper cache synchronization for isochronous data buffers on non-coherent architectures. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
```diff diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c index b6977149394e..6628feaa7622 100644 --- a/drivers/firewire/ohci.c +++ b/drivers/firewire/ohci.c @@ -126,6 +126,7 @@ struct context { struct fw_ohci *ohci; u32 regs; int total_allocation; + u32 current_bus; bool running; bool flushing; ...
32eaeae177bf77fbc224c35262add45bd5e6abb3
Analyze and fix the following issue in the Linux kernel code: firewire: ohci: work around selfID junk due to wrong gap count
Problem Details: If a device's firmware initiates a bus reset by setting the IBR bit in PHY register 1 without resetting the gap count field to 63 (and without having sent a PHY configuration packet beforehand), the gap count of this node will remain at the old value after the bus reset and thus be inconsistent with th...
```diff diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c index bffc2ad7ecab..b6977149394e 100644 --- a/drivers/firewire/ohci.c +++ b/drivers/firewire/ohci.c @@ -1860,8 +1860,22 @@ static void bus_reset_work(struct work_struct *work) for (i = 1, j = 0; j < self_id_count; i += 2, j++) { if (ohci->sel...
4b1cfcb4f36dca33b4552d9612537e6c0ca73639
Analyze and fix the following issue in the Linux kernel code: ASoC: Fix prefixing of DAPM controls
Problem Details: We don't want to clear the prefix while we're creating the DAPM controls for the device as the prefix is applied during control creation. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
```diff diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index d6af52bd97df..a5d3685a5d38 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1055,13 +1055,13 @@ static int soc_post_component_init(struct snd_soc_card *card, } rtd->card = card; + /* Make sure all DAPM widgets are instantiated ...
2db3fcf1b74ed2587a4072224a3c92da7dff5647
Analyze and fix the following issue in the Linux kernel code: ARM: mach-mxs: fix machines' initializers order
Problem Details: Signed-off-by: Lauri Hintsala <lauri.hintsala@bluegiga.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
```diff diff --git a/arch/arm/mach-mxs/mach-mx23evk.c b/arch/arm/mach-mxs/mach-mx23evk.c index 3c2de33803ab..8fa2290f37f8 100644 --- a/arch/arm/mach-mxs/mach-mx23evk.c +++ b/arch/arm/mach-mxs/mach-mx23evk.c @@ -182,6 +182,6 @@ MACHINE_START(MX23EVK, "Freescale MX23 EVK") /* Maintainer: Freescale Semiconductor, Inc. *...
0c5d37033b3a16fdf6442730cee82dd3e8465fb1
Analyze and fix the following issue in the Linux kernel code: vmwgfx: memory leaks caused by double allocation
Problem Details: These variables get allocated twice so the first allocation is a memory leak. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
```diff diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c index 35d5f61fc7e4..15fb26088d68 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c @@ -953,8 +953,7 @@ int vmw_event_fence_action_create(struct drm_file *file_priv, uint...
a0f92199243adbfe765963d4b4e65d7cbe1eb785
Analyze and fix the following issue in the Linux kernel code: drm: fix error message about failed procfs file registration
Problem Details: It printed garbage. Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
```diff diff --git a/drivers/gpu/drm/drm_proc.c b/drivers/gpu/drm/drm_proc.c index 9e5b07efebb7..0f3c4e3cafc3 100644 --- a/drivers/gpu/drm/drm_proc.c +++ b/drivers/gpu/drm/drm_proc.c @@ -95,7 +95,6 @@ int drm_proc_create_files(struct drm_info_list *files, int count, struct drm_device *dev = minor->dev; struct proc_...
a4863ca93ccc52a83e7fbfc068b411b7faa03805
Analyze and fix the following issue in the Linux kernel code: drm/radeon/kms/DCE4.1: fix Select_CrtcSource EncodeMode setting for DP bridges (v2)
Problem Details: Settings in this table reflect the physical panel/connector rather than the internal dig encoding. v2: fix typo for DRM_MODE_CONNECTOR_VGA case. Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
```diff diff --git a/drivers/gpu/drm/radeon/radeon_encoders.c b/drivers/gpu/drm/radeon/radeon_encoders.c index a90d9eeb96a3..eb3f6dc6df83 100644 --- a/drivers/gpu/drm/radeon/radeon_encoders.c +++ b/drivers/gpu/drm/radeon/radeon_encoders.c @@ -1638,7 +1638,17 @@ atombios_set_encoder_crtc_source(struct drm_encoder *encod...
3a6dea31453a101bd5e9e9c89a79f4fcb6b0342e
Analyze and fix the following issue in the Linux kernel code: drm/radeon/kms/DCE4.1: fix dig encoder to transmitter mapping
Problem Details: llano has fully routeable dig encoders similar to DCE3.2 while ontario has a hardcoded mapping similar to DCE4.0. Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
```diff diff --git a/drivers/gpu/drm/radeon/radeon_encoders.c b/drivers/gpu/drm/radeon/radeon_encoders.c index 8a171b21b453..a90d9eeb96a3 100644 --- a/drivers/gpu/drm/radeon/radeon_encoders.c +++ b/drivers/gpu/drm/radeon/radeon_encoders.c @@ -1756,10 +1756,15 @@ static int radeon_atom_pick_dig_encoder(struct drm_encode...
cc3405151572c4920ac187a9ef601c838fac077b
Analyze and fix the following issue in the Linux kernel code: drm/radeon/kms: cleanup benchmark code
Problem Details: factor out repeated code into functions fix units in which the throughput is reported (megabytes per second and megabits per second make sense, others are kind of confusing) make report more amenable to awk and friends (e.g. whitespace is always the separator, unit is separated from the number, etc) ad...
```diff diff --git a/drivers/gpu/drm/radeon/radeon_benchmark.c b/drivers/gpu/drm/radeon/radeon_benchmark.c index 10191d9372d8..6951426dbb12 100644 --- a/drivers/gpu/drm/radeon/radeon_benchmark.c +++ b/drivers/gpu/drm/radeon/radeon_benchmark.c @@ -26,21 +26,80 @@ #include "radeon_reg.h" #include "radeon.h" -void rad...
ccf4d883f82e10053fa5806f2cd35401012bec84
Analyze and fix the following issue in the Linux kernel code: drm/exynos: fixed page flip bug.
Problem Details: in case of using two drivers such as fimd and hdmi controller that they have their own hardware interrupt, drm framework doesn't provide pipe number corresponding to it. so the pipe should be set to event's from specific crtc. Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com> Signed-off-by: Inki D...
```diff diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c b/drivers/gpu/drm/exynos/exynos_drm_crtc.c index 8cd9d8eec46e..9337e5e2dbb6 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c @@ -259,13 +259,21 @@ static int exynos_drm_crtc_page_flip(struct drm_crtc *crtc,...
601b44e3db833d28af66d4d6eaf5d353430914d0
Analyze and fix the following issue in the Linux kernel code: drm/exynos: fixed bug to exynos_drm_fb_dev_reinit().
Problem Details: this patch solves the problem that fb_helper is released when exynos_drm_fbdev_reinit() was called. if this function call is ok then just return. Signed-off-by: Inki Dae <inki.dae@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
```diff diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c index 61345154b6f5..4366dc5032ef 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c @@ -432,6 +432,8 @@ int exynos_drm_fbdev_reinit(struct drm_device *dev) re...
488479ebcbdfabbc4d2ae3fab13971bba3ced605
Analyze and fix the following issue in the Linux kernel code: drm/radeon: Drop inlines from evergreen_cs.c / r600_cs.c
Problem Details: Fixes evergreen_cs_parse 4080 23124 +19044 and others compared to a non force inline kernel. Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
```diff diff --git a/drivers/gpu/drm/radeon/evergreen_cs.c b/drivers/gpu/drm/radeon/evergreen_cs.c index a134790903d3..35dce993c8f8 100644 --- a/drivers/gpu/drm/radeon/evergreen_cs.c +++ b/drivers/gpu/drm/radeon/evergreen_cs.c @@ -122,7 +122,7 @@ static void evergreen_cs_track_init(struct evergreen_cs_track *track) t...