id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
3083314238afb593b598dca4bab4bb6ae09a6c82
Analyze and fix the following issue in the Linux kernel code: arm: mach-omap2: mux: fix buffer overrun
Problem Details: memcpy() copies 8 bytes too much (omap_mux_entry vs. omap_mux). Correct by replacing memcpy() with struct assignment, which is safer. Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
```diff diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c index 17bd6394d224..df8d2f2872c6 100644 --- a/arch/arm/mach-omap2/mux.c +++ b/arch/arm/mach-omap2/mux.c @@ -893,7 +893,7 @@ static struct omap_mux * __init omap_mux_list_add( return NULL; m = &entry->mux; - memcpy(m, src, sizeof(struct om...
55db8387a5e8d07407f0b7c6b2526417a2bc6243
Analyze and fix the following issue in the Linux kernel code: hwrng: via_rng - Fix memory scribbling on some CPUs
Problem Details: It has been reported that on at least one Nano CPU the xstore instruction will write as many as 16 bytes of data to the output buffer. This causes memory corruption as we use rng->priv which is only 4-8 bytes long. This patch fixes this by using an intermediate buffer on the stack with at least 16 by...
```diff diff --git a/drivers/char/hw_random/via-rng.c b/drivers/char/hw_random/via-rng.c index 7f86666bb393..d0387a84eec1 100644 --- a/drivers/char/hw_random/via-rng.c +++ b/drivers/char/hw_random/via-rng.c @@ -24,6 +24,7 @@ * warranty of any kind, whether express or implied. */ +#include <crypto/padlock.h> #inc...
0735ac1f2551d9f9d356126aaf3b1110150918e6
Analyze and fix the following issue in the Linux kernel code: hwrng: via_rng - Fix asm constraints
Problem Details: The inline asm to invoke xstore did not specify the constraints correctly. In particular, dx/di should have been marked as output registers as well as input as they're modified by xstore. Thanks to Mario Holbe for creating this patch and testing it. Tested-by: Mario 'BitKoenig' Holbe <Mario.Holbe@TU...
```diff diff --git a/drivers/char/hw_random/via-rng.c b/drivers/char/hw_random/via-rng.c index 794aacb715c1..7f86666bb393 100644 --- a/drivers/char/hw_random/via-rng.c +++ b/drivers/char/hw_random/via-rng.c @@ -81,8 +81,7 @@ static inline u32 xstore(u32 *addr, u32 edx_in) ts_state = irq_ts_save(); asm(".byte 0x0F...
dfe63bb0ad9810db13aab0058caba97866e0a681
Analyze and fix the following issue in the Linux kernel code: drm: Update fbdev fb_fix_screeninfo
Problem Details: If you change the color depth via fbset or some other framebuffer aware userland application struct fb_fix_screeninfo is not updated to this new information. This patch fixes this issue. Also the function is changed to just pass in struct drm_framebuffer so in the future we could use more fields. I'm h...
```diff diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index 5c4f9b9ecdc0..0307d601f5e5 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -607,6 +607,25 @@ void drm_fb_helper_fini(struct drm_fb_helper *fb_helper) } EXPORT_SYMBOL(drm_fb_helper_fini); ...
c0312b33daa721a92633181fd4fe508484c81a2d
Analyze and fix the following issue in the Linux kernel code: ARM: mach-shmobile: update for GIC changes.
Problem Details: This fixes up the SMP support to use the refactored GIC APIs. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
```diff diff --git a/arch/arm/mach-shmobile/entry-gic.S b/arch/arm/mach-shmobile/entry-gic.S index 6e4fa4715199..e20239b08c83 100644 --- a/arch/arm/mach-shmobile/entry-gic.S +++ b/arch/arm/mach-shmobile/entry-gic.S @@ -2,19 +2,17 @@ * ARM Interrupt demux handler using GIC * * Copyright (C) 2010 Magnus Damm - * Co...
6ef9f6fd8eb22f4838e9b0006d16936511e3f7f8
Analyze and fix the following issue in the Linux kernel code: ARM: mach-shmobile: Fix up clkdev fallout for SH73A0.
Problem Details: Use the new linux/clkdev.h to get it building again. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
```diff diff --git a/arch/arm/mach-shmobile/clock-sh73a0.c b/arch/arm/mach-shmobile/clock-sh73a0.c index c196a288f222..720a71433be6 100644 --- a/arch/arm/mach-shmobile/clock-sh73a0.c +++ b/arch/arm/mach-shmobile/clock-sh73a0.c @@ -20,8 +20,8 @@ #include <linux/kernel.h> #include <linux/io.h> #include <linux/sh_clk.h...
3bd75e5e0c5b58636aeadd34890114bcb988777e
Analyze and fix the following issue in the Linux kernel code: sh: mach-sdk7786: Fix up fallout from clkdev consolidation.
Problem Details: CC arch/sh/boards/mach-sdk7786/setup.o arch/sh/boards/mach-sdk7786/setup.c:179: error: variable 'sdk7786_pcie_cl' has initializer but incomplete type arch/sh/boards/mach-sdk7786/setup.c:180: error: unknown field 'con_id' specified in initializer arch/sh/boards/mach-sdk7786/setup.c:180: warning: ex...
```diff diff --git a/arch/sh/boards/mach-sdk7786/setup.c b/arch/sh/boards/mach-sdk7786/setup.c index 75e4ddbbec3e..5b302d690ee5 100644 --- a/arch/sh/boards/mach-sdk7786/setup.c +++ b/arch/sh/boards/mach-sdk7786/setup.c @@ -15,13 +15,13 @@ #include <linux/i2c.h> #include <linux/irq.h> #include <linux/clk.h> +#include...
168f2e14319aba3125946649604e858cbae85be6
Analyze and fix the following issue in the Linux kernel code: pstore: fix build warning for unused return value from sysfs_create_file
Problem Details: fs/pstore/inode.c: In function 'init_pstore_fs': fs/pstore/inode.c:266: warning: ignoring return value of 'sysfs_create_file', declared with attribute warn_unused_result Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Tony Luck <tony.luck@intel.com>
```diff diff --git a/fs/pstore/inode.c b/fs/pstore/inode.c index 0e806aafe857..549d245d0b42 100644 --- a/fs/pstore/inode.c +++ b/fs/pstore/inode.c @@ -256,23 +256,28 @@ static struct file_system_type pstore_fs_type = { static int __init init_pstore_fs(void) { - int ret = 0; + int rc = 0; struct kobject *pstorefs_...
4c65595ec506ff65c90b1d9fed17333005fa5eb5
Analyze and fix the following issue in the Linux kernel code: m68knommu: fix broken setting of irq_chip and handler
Problem Details: Fix compile error, by using correct loop variable: arch/m68knommu/platform/68328/ints.c: In function ‘init_IRQ’: arch/m68knommu/platform/68328/ints.c:182: error: ‘irq’ undeclared (first use in this function) arch/m68knommu/platform/68328/ints.c:182: error: (Each undeclared identifier is reported only ...
```diff diff --git a/arch/m68knommu/platform/68328/ints.c b/arch/m68knommu/platform/68328/ints.c index 865852806a17..2a3af193ccd3 100644 --- a/arch/m68knommu/platform/68328/ints.c +++ b/arch/m68knommu/platform/68328/ints.c @@ -179,8 +179,8 @@ void __init init_IRQ(void) IMR = ~0; for (i = 0; (i < NR_IRQS); i++) { ...
24056f525051a9e186af28904b396320e18bf9a0
Analyze and fix the following issue in the Linux kernel code: ARM: DMA: add support for DMA debugging
Problem Details: Add ARM support for the DMA debug infrastructure, which allows the DMA API usage to be debugged. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
```diff diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 47694865018c..ca2ab3d28639 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -2,6 +2,7 @@ config ARM bool default y select HAVE_AOUT + select HAVE_DMA_API_DEBUG select HAVE_IDE select HAVE_MEMBLOCK select RTC_LIB diff --git a/arch/arm/comm...
f006d25a15216a483cec71e886786874f66f9452
Analyze and fix the following issue in the Linux kernel code: perf tools: Fix buffer overflow error when specifying all tracepoints
Problem Details: I found when specifying all tracepoints with -e to one of subcommand, such as 'stat', the program will trigger a buffer overflow error, like this: *** buffer overflow detected ***: ./perf terminated ======= Backtrace: ========= /lib64/libc.so.6(__fortify_fail+0x37)[0x382cefb2c7] .... The tracepoints ...
```diff diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index 649083f27e08..917a0ca521c1 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c @@ -490,6 +490,31 @@ parse_multiple_tracepoint_event(char *sys_name, const char *evt_exp, return EVT_HANDLED_ALL; } ...
4e3dbdb1392a83bd21a6ff8f6bc785495058d37c
Analyze and fix the following issue in the Linux kernel code: cassini: Use local-mac-address prom property for Cassini MAC address
Problem Details: Fallback on the local-mac-address prom property if the Cassini device does not have an address programmed in the VPD ROM. This uses the same technique as implemented by the sungem driver. The problem was reported by Frans van Berckel using Debian kernel 2.6.34-7 on Sun Fire V440. udev was assigning a ...
```diff diff --git a/drivers/net/cassini.c b/drivers/net/cassini.c index 73502fef8769..7206ab2cbbf8 100644 --- a/drivers/net/cassini.c +++ b/drivers/net/cassini.c @@ -3203,6 +3203,10 @@ static int cas_get_vpd_info(struct cas *cp, unsigned char *dev_addr, int phy_type = CAS_PHY_MII_MDIO0; /* default phy type */ int ...
b7edfaa1983362842351e425adeb8e297b4c11fb
Analyze and fix the following issue in the Linux kernel code: pnfs: add prefix to struct pnfs_layout_hdr fields
Problem Details: Signed-off-by: Fred Isaman <iisaman@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
```diff diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c index 738d6a4e77fe..23f930caf1e2 100644 --- a/fs/nfs/nfs4filelayout.c +++ b/fs/nfs/nfs4filelayout.c @@ -82,7 +82,7 @@ filelayout_check_layout(struct pnfs_layout_hdr *lo, { struct nfs4_file_layout_dsaddr *dsaddr; int status = -EINVAL; - struct n...
566052c53b5146e23a99ab95fb5c11f8a295a084
Analyze and fix the following issue in the Linux kernel code: pnfs: add prefix to struct pnfs_layout_segment fields
Problem Details: While we are renaming all the fields, change lo->state to lo->plh_flags. Signed-off-by: Fred Isaman <iisaman@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
```diff diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c index 2e92f0d8d654..738d6a4e77fe 100644 --- a/fs/nfs/nfs4filelayout.c +++ b/fs/nfs/nfs4filelayout.c @@ -243,7 +243,7 @@ filelayout_alloc_lseg(struct pnfs_layout_hdr *layoutid, static void filelayout_free_lseg(struct pnfs_layout_segment *lseg) { -...
52fabd73199cd00932f92c9f548bdf66a5bbc23d
Analyze and fix the following issue in the Linux kernel code: pnfs: fix incorrect comment in destroy_lseg
Problem Details: Comment references get_layout_hdr_locked, which never existed in submitted code. Signed-off-by: Fred Isaman <iisaman@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
```diff diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index db773428f95f..6e9daffa5a37 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c @@ -225,7 +225,7 @@ destroy_lseg(struct kref *kref) dprintk("--> %s\n", __func__); NFS_SERVER(ino)->pnfs_curr_ld->free_lseg(lseg); - /* Matched by get_layout_hdr_locked in pnfs_insert...
c36fca52f5e4594ffd0ff175b328966b0d393184
Analyze and fix the following issue in the Linux kernel code: NFS refactor nfs_find_client and reference client across callback processing
Problem Details: Fixes a bug where the nfs_client could be freed during callback processing. Refactor nfs_find_client to use minorversion specific means to locate the correct nfs_client structure. In the NFS layer, V4.0 clients are found using the callback_ident field in the CB_COMPOUND header. V4.1 clients are found...
```diff diff --git a/fs/nfs/callback.c b/fs/nfs/callback.c index c0b05497972b..15677e7bede5 100644 --- a/fs/nfs/callback.c +++ b/fs/nfs/callback.c @@ -16,9 +16,7 @@ #include <linux/freezer.h> #include <linux/kthread.h> #include <linux/sunrpc/svcauth_gss.h> -#if defined(CONFIG_NFS_V4_1) #include <linux/sunrpc/bc_xpr...
71e161a6a9fa021a280e564254fcda894e6fbd14
Analyze and fix the following issue in the Linux kernel code: SUNRPC fix bc_send print
Problem Details: Signed-off-by: Andy Adamson <andros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
```diff diff --git a/net/sunrpc/bc_svc.c b/net/sunrpc/bc_svc.c index 7dcfe0cc3500..1dd1a6890007 100644 --- a/net/sunrpc/bc_svc.c +++ b/net/sunrpc/bc_svc.c @@ -59,8 +59,8 @@ int bc_send(struct rpc_rqst *req) ret = task->tk_status; rpc_put_task(task); } - return ret; dprintk("RPC: bc_send ret= %d\n", ret)...
09798eb9479da3413bdf96e7d22a84d8b21e05e1
Analyze and fix the following issue in the Linux kernel code: atyfb: Fix bootup hangs on sparc64.
Problem Details: After commit 25edd6946a1d74e5e77813c2324a0908c68bcf9e ("sparc64: Get rid of indirect p1275 PROM call buffer.") we can't pass virtual addresses >4GB to PROM calls. Largely this is never necessary in drivers because we have a copy of the entire PROM device tree in the kernel and a set of of_*() interfa...
```diff diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c index 5bf91236c701..5a3ce3ad1ec8 100644 --- a/drivers/video/aty/atyfb_base.c +++ b/drivers/video/aty/atyfb_base.c @@ -2969,10 +2969,8 @@ static int __devinit atyfb_setup_sparc(struct pci_dev *pdev, { struct atyfb_par *par = info->pa...
68d7c1aa2fee6acb11fcb826a207e4b81d8a1f57
Analyze and fix the following issue in the Linux kernel code: cnic: Fix the type field in SPQ messages
Problem Details: The new firmware interface requires each Slow Path Queue (SPQ) message's type field to include the function number. The existing code does not do this consistently. We fix this by OR'ing in the function number into the type field centrally in cnic_submit_kwqe_16(). Signed-off-by: Michael Chan <mchan...
```diff diff --git a/drivers/net/cnic.c b/drivers/net/cnic.c index aa5016ad9e19..263a2944566f 100644 --- a/drivers/net/cnic.c +++ b/drivers/net/cnic.c @@ -1290,12 +1290,18 @@ static int cnic_submit_kwqe_16(struct cnic_dev *dev, u32 cmd, u32 cid, struct cnic_local *cp = dev->cnic_priv; struct l5cm_spe kwqe; struct...
cba85b532e4aabdb97f44c18987d45141fd93faa
Analyze and fix the following issue in the Linux kernel code: netfilter: fix export secctx error handling
Problem Details: In 1ae4de0cdf855305765592647025bde55e85e451, the secctx was exported via the /proc/net/netfilter/nf_conntrack and ctnetlink interfaces instead of the secmark. That patch introduced the use of security_secid_to_secctx() which may return a non-zero value on error. In one of my setups, I have NF_CONNTRA...
```diff diff --git a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c index 37f8adb68c79..63f60fc5d26a 100644 --- a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c +++ b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c @@ -97,7 +97,7 @@ static int ...
f682cefa5ad204d3bfaa54a58046c66d2d035ac1
Analyze and fix the following issue in the Linux kernel code: netfilter: fix the race when initializing nf_ct_expect_hash_rnd
Problem Details: Since nf_ct_expect_dst_hash() may be called without nf_conntrack_lock locked, nf_ct_expect_hash_rnd should be initialized in the atomic way. In this patch, we use nf_conntrack_hash_rnd instead of nf_ct_expect_hash_rnd. Signed-off-by: Changli Gao <xiaosuo@gmail.com> Acked-by: Eric Dumazet <eric.dumaze...
```diff diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h index caf17db87dbc..d85cff10e169 100644 --- a/include/net/netfilter/nf_conntrack.h +++ b/include/net/netfilter/nf_conntrack.h @@ -298,6 +298,8 @@ static inline int nf_ct_is_untracked(const struct nf_conn *ct) extern int nf...
2a8fe003741aa90b6b9453e90af4bbb7bc42918c
Analyze and fix the following issue in the Linux kernel code: dcb: use after free in dcb_flushapp()
Problem Details: The original code has a use after free bug because it's not using the _safe() version of the list_for_each_entry() macro. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c index 4323bd441f0f..d900ab99814a 100644 --- a/net/dcb/dcbnl.c +++ b/net/dcb/dcbnl.c @@ -1643,9 +1643,10 @@ EXPORT_SYMBOL(dcb_setapp); static void dcb_flushapp(void) { struct dcb_app_type *app; + struct dcb_app_type *tmp; spin_lock(&dcb_lock); - list_for_eac...
4b886136df2b923b6fc6b2d83faa9554e84e05ab
Analyze and fix the following issue in the Linux kernel code: CIFS: Add match_port check during looking for an existing connection (try #4)
Problem Details: If we have a share mounted by non-standard port and try to mount another share on the same host with standard port, we connect to the first share again - that's wrong. This patch fixes this bug. Signed-off-by: Pavel Shilovsky <piastryyy@gmail.com> Reviewed-by: Jeff Layton <jlayton@samba.org> Signed-of...
```diff diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index b90c7411f4f0..41f002fb4a04 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -1453,6 +1453,40 @@ srcip_matches(struct sockaddr *srcaddr, struct sockaddr *rhs) } } +/* + * If no port is specified in addr structure, we try to match with 445 por...
568389c257fa7d74ce36c2f78bad31965fded4cf
Analyze and fix the following issue in the Linux kernel code: serial: apbuart: Fixup apbuart_console_init()
Problem Details: commit 35c64e5d (drivers: serial: apbuart: Handle OF failures gracefully) missed that the modified grlib_apbuart_configure() function is called from apbuart_console_init() as well. Fix the fallout. Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Thomas Gleixner <tglx@linutronix.de...
```diff diff --git a/drivers/serial/apbuart.c b/drivers/serial/apbuart.c index 2e84d9c3d419..a30bb9620c9b 100644 --- a/drivers/serial/apbuart.c +++ b/drivers/serial/apbuart.c @@ -520,11 +520,12 @@ static struct console grlib_apbuart_console = { }; -static void grlib_apbuart_configure(void); +static int grlib_apbua...
a4264b3f4049ae7aeeb0017f8158119e22fa354f
Analyze and fix the following issue in the Linux kernel code: UDF: Close small mem leak in udf_find_entry()
Problem Details: Hi, There's a small memory leak in fs/udf/namei.c::udf_find_entry(). We dynamically allocate memory for 'fname' with kmalloc() and in most situations we free it before we leave the function, but there is one situation where we do not (but should). This patch closes the leak by jumping to the 'out_ok'...
```diff diff --git a/fs/udf/namei.c b/fs/udf/namei.c index a2974f7563a2..2be0f9eb86d2 100644 --- a/fs/udf/namei.c +++ b/fs/udf/namei.c @@ -227,10 +227,8 @@ static struct fileIdentDesc *udf_find_entry(struct inode *dir, } if ((cfi->fileCharacteristics & FID_FILE_CHAR_PARENT) && - isdotdot) { - brelse(epos...
4651c5900e7a3c84d4b70412f8bbc40c1bcb50cf
Analyze and fix the following issue in the Linux kernel code: udf: Fix directory corruption after extent merging
Problem Details: If udf_bread() called from udf_add_entry() managed to merge created extent to an already existing one (or if previous extents could be merged), the code truncating the last extent to proper size would just overwrite the freshly allocated extent with an extent that used to be in that place. This obviou...
```diff diff --git a/fs/udf/namei.c b/fs/udf/namei.c index 26815a25379d..a2974f7563a2 100644 --- a/fs/udf/namei.c +++ b/fs/udf/namei.c @@ -471,15 +471,19 @@ add: f_pos >> dir->i_sb->s_blocksize_bits, 1, err); if (!fibh->ebh) goto out_err; + /* Extents could have been merged, invalidate our position */ + b...
52d039fdaa78c5a9f9bc2940ad58d7ed76b8336d
Analyze and fix the following issue in the Linux kernel code: mtd: pxa3xx_nand: NULL dereference in pxa3xx_nand_probe
Problem Details: "info->cmdset" gets dereferenced in __readid() so it needs to be initialized earlier in the function. This bug was introduced in 18c81b1828f8 "mtd: pxa3xx_nand: remove the flash info in driver structure". Cc: stable@kernel.org [2.6.37+] Reported-and-tested-by: Sven Neumann <s.neumann@raumfeld.com> Si...
```diff diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c index 17f8518cc5eb..ea2c288df3f6 100644 --- a/drivers/mtd/nand/pxa3xx_nand.c +++ b/drivers/mtd/nand/pxa3xx_nand.c @@ -885,6 +885,7 @@ static int pxa3xx_nand_detect_config(struct pxa3xx_nand_info *info) /* set info fields needed to __...
a121f643993474548fe98144514c50dd4f3dbe76
Analyze and fix the following issue in the Linux kernel code: UBI: use mtd->writebufsize to set minimal I/O unit size
Problem Details: Previously we used mtd->writesize field to set UBI's minimal I/O unit size. This sometimes caused UBIFS recovery issues when mounting an uncleanly unmounted UBIFS partition on NOR flash since mtd->writesize is 1 byte for NOR flash. The MTD CFI driver however often performs writing multiple bytes in one...
```diff diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c index 5ebe280225d6..f49e49dc5928 100644 --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c @@ -672,7 +672,33 @@ static int io_init(struct ubi_device *ubi) ubi->nor_flash = 1; } - ubi->min_io_size = ubi->mtd->writesize; + /* + * Set ...
0e4ca7e5101e7f4054452b8d71c535eec64a187b
Analyze and fix the following issue in the Linux kernel code: mtd: add writebufsize field to mtd_info struct
Problem Details: This field will be used to indicate the write buffer size of the MTD device. UBI will set it's minimal I/O unit size (min_io_size) to the indicated write buffer size. By this change we intend to fix failed recovery of UBIFS partitions we currently observe on NOR flash when mounting the partition after ...
```diff diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index fe8d77ebec13..9d5306bad117 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h @@ -144,6 +144,17 @@ struct mtd_info { */ uint32_t writesize; + /* + * Size of the write buffer used by the MTD. MTD devices having a write +...
8fffed8cfdd511056cb17c70f525017fbb643b94
Analyze and fix the following issue in the Linux kernel code: mtd: m25p80: Fix JEDEC ID for AT26DF321
Problem Details: The last byte of the ID should be zero for this chip. Was added in commit d0e8c47c58575b9131e786edb488fd029eba443e . Reported by Tomi Varjo. Signed-off-by: Aleksandr Koltsoff <aleksandr.koltsoff@ebts.fi> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
```diff diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c index 9c59ff6b6926..e4eba6cc1b2e 100644 --- a/drivers/mtd/devices/m25p80.c +++ b/drivers/mtd/devices/m25p80.c @@ -653,7 +653,7 @@ static const struct spi_device_id m25p_ids[] = { { "at26f004", INFO(0x1f0400, 0, 64 * 1024, 8, SECT_4K) ...
dcf12463c3416b4a8fc84545233424df0a91e406
Analyze and fix the following issue in the Linux kernel code: mtd: m25p80: add debugging trace in sst_write
Problem Details: Add a DEBUG(MTD_DEBUG_LEVEL2, ..) trace at beginning of sst_write() function as it is done in m25p80_write() function. Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
```diff diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c index eabe5fb071c6..9c59ff6b6926 100644 --- a/drivers/mtd/devices/m25p80.c +++ b/drivers/mtd/devices/m25p80.c @@ -497,6 +497,10 @@ static int sst_write(struct mtd_info *mtd, loff_t to, size_t len, size_t actual; int cmd_sz, ret; + DE...
e0c1a921f62d22d1aa62c72ddb793f898945ff5a
Analyze and fix the following issue in the Linux kernel code: mtd: OneNAND: lighten scary initial bad block messages
Problem Details: Initial bad blocks are normal but the messages look like errors. Make the messages less scary, make the main message an informational message not a warning, make the message displaying registers a debug message and include the address there instead of in the informational message. Signed-off-by: Adri...
```diff diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c index 88f23e3f3014..2d7c90de3144 100644 --- a/drivers/mtd/onenand/onenand_base.c +++ b/drivers/mtd/onenand/onenand_base.c @@ -1484,8 +1484,7 @@ static int onenand_bbt_wait(struct mtd_info *mtd, int state) { struct onenand_ch...
0b524fb9314dc852d6a029296545ddbb17709a8b
Analyze and fix the following issue in the Linux kernel code: mtd: nand: choose correct chip name (ONFI bug)
Problem Details: We have the order of the conditional wrong for choosing the ONFI chip name vs. the ID table name. Without this fix, we will almost *always* choose a NULL string to print out instead of the correct one. This has already been suggested by Matthieu Castet. Signed-off-by: Brian Norris <computersforpeace@...
```diff diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index 9c8da741dce0..c52ded31a12e 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c @@ -3157,7 +3157,7 @@ ident_done: printk(KERN_INFO "NAND device: Manufacturer ID:" " 0x%02x, Chip ID: 0x%02x (%s %s)\n", *ma...
d983c54ebd875f5f6fd37c154195c1c456a7af70
Analyze and fix the following issue in the Linux kernel code: mtd: OneNAND: Fix multi block erase support at 4KiB pagesize
Problem Details: Original 4KiB pagesize chip (SLC) doesn't support Multi block erase at Spec. Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
```diff diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c index c38bf9c54a11..88f23e3f3014 100644 --- a/drivers/mtd/onenand/onenand_base.c +++ b/drivers/mtd/onenand/onenand_base.c @@ -2492,7 +2492,8 @@ static int onenand_erase(struct mtd_info *mtd, struct erase_info *instr) /* Grab ...
eeb9cc015f91ff08453040dd5b2fde0dbaac90d3
Analyze and fix the following issue in the Linux kernel code: drm/nvc0: fix init without firmware present
Problem Details: Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
```diff diff --git a/drivers/gpu/drm/nouveau/nvc0_graph.c b/drivers/gpu/drm/nouveau/nvc0_graph.c index 43b44a4b3ab8..5feacd5d5fa4 100644 --- a/drivers/gpu/drm/nouveau/nvc0_graph.c +++ b/drivers/gpu/drm/nouveau/nvc0_graph.c @@ -584,7 +584,7 @@ nvc0_graph_init_ctxctl(struct drm_device *dev) r000260 = nv_mask(dev, 0x000...
e3c92215198cb6aa00ad38db2780faa6b72e0a3f
Analyze and fix the following issue in the Linux kernel code: [media] radio-aimslab.c: Fix gcc 4.5+ bug
Problem Details: gcc 4.5+ doesn't properly evaluate some inlined expressions. A previous patch were proposed by Andrew Morton using noinline. However, the entire inlined function is bogus, so let's just remove it and be happy. Reported-by: Andrew Morton <akpm@linux-foundation.org> Cc: stable@kernel.org Signed-off-by: ...
```diff diff --git a/drivers/media/radio/radio-aimslab.c b/drivers/media/radio/radio-aimslab.c index 05e832f61c3e..6cc5d130fbc8 100644 --- a/drivers/media/radio/radio-aimslab.c +++ b/drivers/media/radio/radio-aimslab.c @@ -31,7 +31,6 @@ #include <linux/module.h> /* Modules */ #include <linux/init.h> /* Initdata ...
748103e7235892bf9a3ee568d7d4dd7e5a3beece
Analyze and fix the following issue in the Linux kernel code: drivers/video/i810/i810-i2c.c: fix i2c bus handling
Problem Details: These patch fix a longstanding bug in the i810 frame buffer driver. The handling of the i2c bus is wrong: A 1 bit should not written to the i2c, these will be done by switch the i2c to input. Driving an 1 bit active is against the i2c spec. An active driven of a 1 bit will result in very strange erro...
```diff diff --git a/drivers/video/i810/i810-i2c.c b/drivers/video/i810/i810-i2c.c index cd2c728a809b..7db17d0d8a8c 100644 --- a/drivers/video/i810/i810-i2c.c +++ b/drivers/video/i810/i810-i2c.c @@ -45,8 +45,10 @@ static void i810i2c_setscl(void *data, int state) struct i810fb_par *par = chan->par; u...
529ed806d4540d23ca2f68b28c3715d1566fc3ac
Analyze and fix the following issue in the Linux kernel code: video: Fix the HGA framebuffer driver
Problem Details: Resurrected some old hardware and fixed up the hgafb driver to work again. Only tested with fbcon, since most fbdev-based software appears to only support 12bpp and up. It does not appear that this driver has worked for at least the entire 2.6.x series, perhaps since 2002. Hercules graphics hardware u...
```diff diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index e231041a5e33..fdddf58bdaf5 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig @@ -824,24 +824,14 @@ config FB_N411 config FB_HGA tristate "Hercules mono graphics support" depends on FB && X86 - select FB_CFB_FILLRECT - select FB_C...
7ee04fd5d5ff74f81d8eee128bc9346ab87c56b8
Analyze and fix the following issue in the Linux kernel code: video: imxfb: Fix the maximum value for yres
Problem Details: MX27 and MX25 have 10 bits in the YMAX field of LCDC Size Register. Fix the maximum value for yres. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
```diff diff --git a/drivers/video/imxfb.c b/drivers/video/imxfb.c index 5c363d026f64..1ab2c2588675 100644 --- a/drivers/video/imxfb.c +++ b/drivers/video/imxfb.c @@ -53,11 +53,8 @@ #define LCDC_SIZE 0x04 #define SIZE_XMAX(x) ((((x) >> 4) & 0x3f) << 20) -#ifdef CONFIG_ARCH_MX1 -#define SIZE_YMAX(y) ((y) & 0x1ff) -#...
dffa18449a334cf436c1fabfb2fcf7d4240c994b
Analyze and fix the following issue in the Linux kernel code: crypto: n2 - use __devexit not __exit in n2_unregister_algs
Problem Details: fixes fedora sparc build failure, thanks to kylem for helping with debugging Signed-off-by: Dennis Gilmore <dgilmore@redhat.com> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
```diff diff --git a/drivers/crypto/n2_core.c b/drivers/crypto/n2_core.c index 88ee01510ec0..337249155c05 100644 --- a/drivers/crypto/n2_core.c +++ b/drivers/crypto/n2_core.c @@ -1542,7 +1542,7 @@ out: return err; } -static void __exit n2_unregister_algs(void) +static void __devexit n2_unregister_algs(void) { m...
c29cfa6d3e3edbbf4688a9b95a5b193d4f1c2575
Analyze and fix the following issue in the Linux kernel code: ARM: S3C2416: Add platform helpers for setup SDHCI
Problem Details: Samsung S3C2416 has two SDHCI controllers compatible with other Samsung's SoCs (S3C64XX, S5PC100 etc...). Add required platform setup code that the devices can be used with sdhci-s3c driver. Signed-off-by: Yauhen Kharuzhy <yauhen.kharuzhy@promwad.com> [kgene.kim@samsung.com: change to __raw_{readl,wr...
```diff diff --git a/arch/arm/mach-s3c2416/Kconfig b/arch/arm/mach-s3c2416/Kconfig index df8d14974c90..69b48a7d1dbd 100644 --- a/arch/arm/mach-s3c2416/Kconfig +++ b/arch/arm/mach-s3c2416/Kconfig @@ -31,6 +31,17 @@ config S3C2416_PM help Internal config node to apply S3C2416 power management +config S3C2416_SETU...
af5dd83b873efd4e1477f2265b6fa15a825aff26
Analyze and fix the following issue in the Linux kernel code: vga_switcheroo: fix build with non switcheroo enabled path.
Problem Details: Signed-off-by: Dave Airlie <airlied@redhat.com>
```diff diff --git a/include/linux/vga_switcheroo.h b/include/linux/vga_switcheroo.h index f80fa9de5b82..4b9a7f596f92 100644 --- a/include/linux/vga_switcheroo.h +++ b/include/linux/vga_switcheroo.h @@ -49,6 +49,7 @@ int vga_switcheroo_process_delayed_switch(void); static inline void vga_switcheroo_unregister_client(s...
2f299d5de02da3ffb1f9e1a05c91dcd1173ebd3c
Analyze and fix the following issue in the Linux kernel code: drm/radeon/kms: adjust quirk for acer laptop
Problem Details: Acer laptop (TravelMate 5730G) has an HDMI connector on the laptop and a DVI connector on the docking station and both share the same encoder, hpd pin, and ddc line. The bios connector table reflects this and is technically correct, however, we drop the DVI connector here since xrandr has no concept of...
```diff diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c index 45bc750e9ae2..6317d2c9e6d9 100644 --- a/drivers/gpu/drm/radeon/radeon_atombios.c +++ b/drivers/gpu/drm/radeon/radeon_atombios.c @@ -313,7 +313,6 @@ static bool radeon_atom_apply_quirks(struct drm_device *dev, ...
a3c888fcda911fcb6e3c071aecf49ccb6effe79d
Analyze and fix the following issue in the Linux kernel code: gen_init_cpio: checkpatch fixes
Problem Details: Cc: Jesper Juhl <jj@chaosbits.net> Cc: Michal Marek <mmarek@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Michal Marek <mmarek@suse.cz>
```diff diff --git a/usr/gen_init_cpio.c b/usr/gen_init_cpio.c index f463cafdccb2..7f06884ecd41 100644 --- a/usr/gen_init_cpio.c +++ b/usr/gen_init_cpio.c @@ -315,9 +315,9 @@ static int cpio_mkfile(const char *name, const char *location, goto error; } - retval = fstat (file, &buf); + retval = fstat(file, &buf); ...
329620a878cf89184b28500d37fa33cc870a3357
Analyze and fix the following issue in the Linux kernel code: xen/xenbus: making backend support modular is too complex
Problem Details: Impact: build fix Making the xenbus backend support a separate module is needlessly complex and causes build failures. Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
```diff diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig index 554ed573c028..5a48ce996dea 100644 --- a/drivers/xen/Kconfig +++ b/drivers/xen/Kconfig @@ -30,7 +30,7 @@ config XEN_DEV_EVTCHN If in doubt, say yes. config XEN_BACKEND - tristate "Backend driver support" + bool "Backend driver support" depends...
a16448e071ca80e599ea4f780242f40a0a213b07
Analyze and fix the following issue in the Linux kernel code: xen/xenbus: cleanup debug noise in xenbus_comms.c
Problem Details: Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> Signed-off-by: Ian Campbell <ian.campbell@citrix.com> [corresponds to 6796c12281dc in git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen.git] Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
```diff diff --git a/drivers/xen/xenbus/xenbus_comms.c b/drivers/xen/xenbus/xenbus_comms.c index 700dc7714838..090c61ee8fd0 100644 --- a/drivers/xen/xenbus/xenbus_comms.c +++ b/drivers/xen/xenbus/xenbus_comms.c @@ -49,7 +49,6 @@ static DECLARE_WAIT_QUEUE_HEAD(xb_waitq); static irqreturn_t wake_waiting(int irq, void *u...
c3676e8462009d84dce89a454956460de3bfdca7
Analyze and fix the following issue in the Linux kernel code: xen/xenbus: make sure backend bus is registered earlier
Problem Details: Impact: bugfix Need to register it before any drivers want to attach. Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> Signed-off-by: Ian Campbell <ian.campbell@citrix.com> [corresponds to a7a9c3a942c6 in git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen.git] Signed-off-by: ...
```diff diff --git a/drivers/xen/xenbus/xenbus_probe_backend.c b/drivers/xen/xenbus/xenbus_probe_backend.c index 3bd38123e69a..a3cc5351fe29 100644 --- a/drivers/xen/xenbus/xenbus_probe_backend.c +++ b/drivers/xen/xenbus/xenbus_probe_backend.c @@ -295,5 +295,4 @@ static int __init xenbus_probe_backend_init(void) ret...
806f5463d2598ea23a7a688c47c2774846fe7f2f
Analyze and fix the following issue in the Linux kernel code: xenbus/frontend: register bus earlier
Problem Details: Impact: bugfix Make sure the frontend bus is registered early, before any drivers want to attach. Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> Signed-off-by: Ian Campbell <ian.campbell@citrix.com> [corresponds to 1d5df318f87f in git://git.kernel.org/pub/scm/linux/kernel/git/jer...
```diff diff --git a/drivers/xen/xenbus/xenbus_probe_frontend.c b/drivers/xen/xenbus/xenbus_probe_frontend.c index dd31d5a43b40..ccd201f47927 100644 --- a/drivers/xen/xenbus/xenbus_probe_frontend.c +++ b/drivers/xen/xenbus/xenbus_probe_frontend.c @@ -278,8 +278,7 @@ static int __init xenbus_probe_frontend_init(void) ...
f8b6e31e4e46bf514c27fce38783ed5615cca01d
Analyze and fix the following issue in the Linux kernel code: IB/srp: allow task management without a previous request
Problem Details: We can only have one task management comment outstanding, so move the completion and status to the target port. This allows us to handle resets of a LUN without a corresponding request having been sent. Meanwhile, we don't need to play games with host_scribble, just use it as the pointer it is. This f...
```diff diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index 1e1e347a7715..29429a13fd90 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c @@ -542,6 +542,7 @@ static void srp_unmap_data(struct scsi_cmnd *scmnd, static void srp_remove_req(s...
68b65f7305e54b822b2483c60de7d7b017526a92
Analyze and fix the following issue in the Linux kernel code: ARM: PL011: Add support for transmit DMA
Problem Details: Add DMA engine support for transmit to the PL011 driver. Based on a patch from Linus Walliej, with the following changes: - remove RX DMA support. As PL011 doesn't give us receive timeout interrupts, we only get notified of received data when the RX DMA has completed. This rather sucks for inte...
```diff diff --git a/drivers/serial/amba-pl011.c b/drivers/serial/amba-pl011.c index f741a8b51400..ab025dc52fa4 100644 --- a/drivers/serial/amba-pl011.c +++ b/drivers/serial/amba-pl011.c @@ -7,6 +7,7 @@ * * Copyright 1999 ARM Limited * Copyright (C) 2000 Deep Blue Solutions Ltd. + * Copyright (C) 2010 ST-Erics...
d030260ad33b482a371f999c7e9db79ef7a2111f
Analyze and fix the following issue in the Linux kernel code: perf tools: Fix perf_event.h header usage
Problem Details: This patch fixes the usage of the perf_event.h header file between command modules and the supporting code in util. It is necessary to ensure that ALL files use the SAME perf_event.h header from the kernel source tree. There were a couple of #include <linux/perf_event.h> mixed with #include "../../pe...
```diff diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index 863d78d5ef1a..a0ccd69c3fc2 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h @@ -3,7 +3,7 @@ #include <linux/list.h> #include <stdbool.h> -#include <linux/perf_event.h> +#include "../../../include/linux/perf_event.h" #inc...
09e099d4bafea3b15be003d548bdf94b4b6e0e17
Analyze and fix the following issue in the Linux kernel code: block: fix accounting bug on cross partition merges
Problem Details: /proc/diskstats would display a strange output as follows. $ cat /proc/diskstats |grep sda 8 0 sda 90524 7579 102154 20464 0 0 0 0 0 14096 20089 8 1 sda1 19085 1352 21841 4209 0 0 0 0 4294967064 15689 4293424691 ~~~~~~~~~~ 8 2 ...
```diff diff --git a/block/blk-core.c b/block/blk-core.c index 3689319a5974..500c080a6a6b 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -64,13 +64,27 @@ static void drive_stat_acct(struct request *rq, int new_io) return; cpu = part_stat_lock(); - part = disk_map_sector_rcu(rq->rq_disk, blk_rq_pos(rq));...
a7862aa90ffd1113bc2898ae6be2e4861b1f76cc
Analyze and fix the following issue in the Linux kernel code: [media] cx25821: Fix compilation breakage due to BKL dependency
Problem Details: drivers/staging/cx25821/cx25821-video.c: In function ‘video_open’: drivers/staging/cx25821/cx25821-video.c:817:8: error: implicit declaration of function ‘lock_kernel’ drivers/staging/cx25821/cx25821-video.c:834:9: error: implicit declaration of function ‘unlock_kernel’ This patch just adds a header w...
```diff diff --git a/drivers/staging/cx25821/cx25821-video.c b/drivers/staging/cx25821/cx25821-video.c index 998c33acf7bd..0d8d75670516 100644 --- a/drivers/staging/cx25821/cx25821-video.c +++ b/drivers/staging/cx25821/cx25821-video.c @@ -27,6 +27,7 @@ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include "cx25821-v...
554ec063982752e9a569ab9189eeffa3d96731b2
Analyze and fix the following issue in the Linux kernel code: x86: Avoid calling arch_trigger_all_cpu_backtrace() at the same time
Problem Details: The spin_lock_debug/rcu_cpu_stall detector uses trigger_all_cpu_backtrace() to dump cpu backtrace. Therefore it is possible that trigger_all_cpu_backtrace() could be called at the same time on different CPUs, which triggers and 'unknown reason NMI' warning. The following case illustrates the problem: ...
```diff diff --git a/arch/x86/kernel/apic/hw_nmi.c b/arch/x86/kernel/apic/hw_nmi.c index 2b40a6045da2..72ec29e1ae06 100644 --- a/arch/x86/kernel/apic/hw_nmi.c +++ b/arch/x86/kernel/apic/hw_nmi.c @@ -28,10 +28,20 @@ u64 hw_nmi_get_sample_period(void) /* For reliability, we're prepared to waste bits here. */ static DEC...
6bf4123760a5aece6e4829ce90b70b6ffd751d65
Analyze and fix the following issue in the Linux kernel code: sched: Change wait_for_completion_*_timeout() to return a signed long
Problem Details: wait_for_completion_*_timeout() can return: 0: if the wait timed out -ve: if the wait was interrupted +ve: if the completion was completed. As they currently return an 'unsigned long', the last two cases are not easily distinguished which can easily result in buggy code, as is the case for the r...
```diff diff --git a/include/linux/completion.h b/include/linux/completion.h index 36d57f74cd01..51494e6b5548 100644 --- a/include/linux/completion.h +++ b/include/linux/completion.h @@ -81,10 +81,10 @@ extern int wait_for_completion_interruptible(struct completion *x); extern int wait_for_completion_killable(struct c...
cb2ded37fd2e1039f96c8c892da024a8f033add5
Analyze and fix the following issue in the Linux kernel code: x86: Fix APIC ID sizing bug on larger systems, clean up MAX_APICS confusion
Problem Details: Found one x2apic pre-enabled system, x2apic_mode suddenly get corrupted after register some cpus, when compiled CONFIG_NR_CPUS=255 instead of 512. It turns out that generic_processor_info() ==> phyid_set(apicid, phys_cpu_present_map) causes the problem. phys_cpu_present_map is sized by MAX_APICS bits...
```diff diff --git a/arch/x86/include/asm/mpspec.h b/arch/x86/include/asm/mpspec.h index 7c1aebf8fcbf..0c90dd9f0505 100644 --- a/arch/x86/include/asm/mpspec.h +++ b/arch/x86/include/asm/mpspec.h @@ -5,6 +5,7 @@ #include <asm/mpspec_def.h> #include <asm/x86_init.h> +#include <asm/apicdef.h> extern int apic_versio...
c03017544e3b2e60aa3c8ae451fac01595f1bf11
Analyze and fix the following issue in the Linux kernel code: [S390] cio: fix ccwgroup unregistration race condition
Problem Details: A race condition exists in the ccwgroup device unregistration code which can cause a kernel panic due to a use-after-free bug. This race condition might be triggered when all ccw devices associated with a ccwgroup device are removed at the same time (e.g. because the corresponding channel path becomes ...
```diff diff --git a/drivers/s390/cio/ccwgroup.c b/drivers/s390/cio/ccwgroup.c index 97b25d68e3e7..2864581d8ecb 100644 --- a/drivers/s390/cio/ccwgroup.c +++ b/drivers/s390/cio/ccwgroup.c @@ -66,6 +66,27 @@ __ccwgroup_remove_symlinks(struct ccwgroup_device *gdev) } +/* + * Remove references from ccw devices to ccw...
f230886b0b0f0ce604395481bea05f3c0ad8fc9e
Analyze and fix the following issue in the Linux kernel code: [S390] smp: delay idle task creation
Problem Details: Delay idle task creation until a cpu gets set online instead of creating them for all possible cpus at system startup. For one cpu system this should safe more than 1 MB. On my debug system with lots of debug stuff enabled this saves 2 MB. Same as on x86. Signed-off-by: Heiko Carstens <heiko.carstens...
```diff diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c index a9702df22f3a..8e84b5af49ba 100644 --- a/arch/s390/kernel/smp.c +++ b/arch/s390/kernel/smp.c @@ -23,6 +23,7 @@ #define KMSG_COMPONENT "cpu" #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt +#include <linux/workqueue.h> #include <linux/module.h> ...
6f272b9cec285a9610a2acf101f694bc58bed37e
Analyze and fix the following issue in the Linux kernel code: [S390] dasd: Prevent deadlock during suspend/resume.
Problem Details: The freeze callback may set a stop bit so that a worker thread could not start I/O. The discipline specific freeze function waits for the worker to be completed. Set the stop_bit after the discipline specific freeze function has returned and no worker is running. Signed-off-by: Stefan Haberland <stefa...
```diff diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c index f16afe74464f..82d9ce36bd0b 100644 --- a/drivers/s390/block/dasd.c +++ b/drivers/s390/block/dasd.c @@ -2769,6 +2769,10 @@ int dasd_generic_pm_freeze(struct ccw_device *cdev) if (IS_ERR(device)) return PTR_ERR(device); + + if (device-...
4f325184f2d4c1f2258873b2a333005dc4dfcbc0
Analyze and fix the following issue in the Linux kernel code: [S390] qdio: prevent race for shared indicators
Problem Details: If the shared indicator is used the following race leads to an inbound stall: Device CPU0 CPU1 ======================================================== non-shared DSCI =>1 ALSI => 1 Thin INT ALSI => 0 ...
```diff diff --git a/drivers/s390/cio/qdio.h b/drivers/s390/cio/qdio.h index 0f4ef8769a3d..9b6ea3ca3ece 100644 --- a/drivers/s390/cio/qdio.h +++ b/drivers/s390/cio/qdio.h @@ -423,9 +423,9 @@ struct indicator_t { extern struct indicator_t *q_indicators; -static inline int shared_ind(struct qdio_irq *irq_ptr) +stati...
53ec24b1e6c7118a127cf029a1519a2ce55268ec
Analyze and fix the following issue in the Linux kernel code: [S390] zcrypt: Fix check to look for facility bits 2 & 65
Problem Details: Fix the check for ap interupts to look for facility bits 2 and 65. Make sure that we only register interrupts for aps, if the machine has ap interrupt support. This patch is relevant only for the 2.6.37 stable series. Cc: stable@kernel.org Signed-off-by: Felix Beck <felix.beck@de.ibm.com> Signed-off-...
```diff diff --git a/drivers/s390/crypto/ap_bus.c b/drivers/s390/crypto/ap_bus.c index 8fd8c62455e9..a1ba52a09602 100644 --- a/drivers/s390/crypto/ap_bus.c +++ b/drivers/s390/crypto/ap_bus.c @@ -154,7 +154,7 @@ static inline int ap_instructions_available(void) */ static int ap_interrupts_available(void) { - return ...
f6c2ed5dd6ab43447dacc136585fc894e3f3a82d
Analyze and fix the following issue in the Linux kernel code: ASoC: Fix the device references to codec and platform drivers
Problem Details: The soc-core takes the platform and codec driver reference during probe. Few of these references are not released during remove. This cause the platform and codec driver module unload to fail. This patch fixes by the taking only one reference to platform and codec module during probe and releases them...
```diff diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index a233607a73c6..bac7291b6ff6 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1259,9 +1259,6 @@ find_codec: if (!strcmp(codec->name, dai_link->codec_name)) { rtd->codec = codec; - if (!try_module_get(codec->dev->driver->owne...
2742f2ada3578db2fb676c1f23ad6a38d002608e
Analyze and fix the following issue in the Linux kernel code: ASoC: Fix SmartQ compilation
Problem Details: This makes the SmartQ sound driver compile again with recent ASoC changes. Signed-off-by: Maurus Cuelenaere <mcuelenaere@gmail.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
```diff diff --git a/sound/soc/s3c24xx/smartq_wm8987.c b/sound/soc/s3c24xx/smartq_wm8987.c index dd20ca7f4681..aef94c7821a9 100644 --- a/sound/soc/s3c24xx/smartq_wm8987.c +++ b/sound/soc/s3c24xx/smartq_wm8987.c @@ -39,8 +39,8 @@ static int smartq_hifi_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_p...
8c1b5306f0da93f5f9bb9aa7024828cb2b7ab387
Analyze and fix the following issue in the Linux kernel code: ASoC: Change Samsung Kconfig from ASOC_ to SND_SOC_
Problem Details: The rest of ASoC is using SND_SOC_ as the prefix for all the Kconfig symbols so do so for the new Samsung drivers too, rather than using ASOC_ as they currently are. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Seungwhan Youn <sw.youn@samsung.com> Acked-by: Jassi Brar <jas...
```diff diff --git a/sound/soc/samsung/Kconfig b/sound/soc/samsung/Kconfig index 11ff4adf9901..a6a6b5fa2f2f 100644 --- a/sound/soc/samsung/Kconfig +++ b/sound/soc/samsung/Kconfig @@ -1,4 +1,4 @@ -config ASOC_SAMSUNG +config SND_SOC_SAMSUNG tristate "ASoC support for Samsung" depends on ARCH_S3C2410 || ARCH_S3C64XX ...
c070c203cde0e019cd373d3247137be11961deb3
Analyze and fix the following issue in the Linux kernel code: ARM: mach-shmobile: sh73a0: fix div4 table
Problem Details: sh73a0 has divisor[12] setting as 1/7 on FRQCRA. Signed-off-by: Takashi YOSHII <takashi.yoshii.zj@renesas.com> Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
```diff diff --git a/arch/arm/mach-shmobile/clock-sh73a0.c b/arch/arm/mach-shmobile/clock-sh73a0.c index 7c8b5179e444..152c970ed537 100644 --- a/arch/arm/mach-shmobile/clock-sh73a0.c +++ b/arch/arm/mach-shmobile/clock-sh73a0.c @@ -191,7 +191,7 @@ static void div4_kick(struct clk *clk) } static int divisors[] = { 2,...
eac676e531214f1e276645613acae7d7c4529035
Analyze and fix the following issue in the Linux kernel code: sh: correct definitions to access stack pointers
Problem Details: A definition like: #define regs_return_value(regs) ((regs)->regs[0]) called with regs_return_value(foo) will be preprocessed to: ((foo)->foo[0]) ^^^ So to fix this to ensure the preprocessor compiles such calls correctly. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: Paul ...
```diff diff --git a/arch/sh/include/asm/ptrace.h b/arch/sh/include/asm/ptrace.h index f6edc10aa0d3..de167d3a1a80 100644 --- a/arch/sh/include/asm/ptrace.h +++ b/arch/sh/include/asm/ptrace.h @@ -40,8 +40,8 @@ #include <asm/system.h> #define user_mode(regs) (((regs)->sr & 0x40000000)==0) -#define user_stack_pointe...
0762346034a3e94f9c3a5fe8d7c4bcaffbc1cd53
Analyze and fix the following issue in the Linux kernel code: m68knommu: remove command line printing DEBUG
Problem Details: There is no need for the DEBUG based command line printing in here. The kernel will print out the command line in the banner later in the boot up. So remove it. Signed-off-by: Greg Ungerer <gerg@uclinux.org>
```diff diff --git a/arch/m68knommu/kernel/setup.c b/arch/m68knommu/kernel/setup.c index 5c931f9d392c..16b2de7f5101 100644 --- a/arch/m68knommu/kernel/setup.c +++ b/arch/m68knommu/kernel/setup.c @@ -231,11 +231,6 @@ void __init setup_arch(char **cmdline_p) memcpy(boot_command_line, command_line, COMMAND_LINE_SIZE); ...
733f31b764061d976a60c5ee454632d9562900ea
Analyze and fix the following issue in the Linux kernel code: m68knommu: fix clock rate value reported for ColdFire 54xx parts
Problem Details: The instruction timings of the ColdFire 54xx family parts are different to other version 4 parts (or version 2 or 3 parts for that matter too). Move the instruction timing setting into the ColdFire part specific headers, and set the 54xx value appropriately. Signed-off-by: Greg Ungerer <gerg@uclinux....
```diff diff --git a/arch/m68k/include/asm/m5206sim.h b/arch/m68k/include/asm/m5206sim.h index 6cc7a42cc425..b882a210ee6e 100644 --- a/arch/m68k/include/asm/m5206sim.h +++ b/arch/m68k/include/asm/m5206sim.h @@ -12,7 +12,8 @@ #define m5206sim_h /*************************************************************************...
9c68015b149d45a35114b4a1ed44c21fa66bc430
Analyze and fix the following issue in the Linux kernel code: m68knommu: Use symbolic constants for cache operations on M54xx
Problem Details: Now that we have meaningfull symbolic constants for bit definitions of the cache registers of m5407 and m548x chips, use them to improve readability, portability and efficiency of the cache operations. This also fixes __flush_cache_all for m548x chips : implicit DCACHE_SIZE was exact for m5407, but wr...
```diff diff --git a/arch/m68k/include/asm/cacheflush_no.h b/arch/m68k/include/asm/cacheflush_no.h index 8fda331f8a83..29f76204ce1d 100644 --- a/arch/m68k/include/asm/cacheflush_no.h +++ b/arch/m68k/include/asm/cacheflush_no.h @@ -14,7 +14,9 @@ #define flush_cache_dup_mm(mm) do { } while (0) #define flush_cache_ran...
56818a6f9105ac016ecf5907f7cb63bcdab639fe
Analyze and fix the following issue in the Linux kernel code: sparc: rename piggyback_32 to piggyback
Problem Details: Now that we use the same piggyback for 32 and 64 bit we can drop the _32 suffix. Include some trivial unification in the Makefile now that 32 and 64 bit can share the same piggyback command. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/arch/sparc/boot/Makefile b/arch/sparc/boot/Makefile index 06a79a2018de..f9d3bf96806e 100644 --- a/arch/sparc/boot/Makefile +++ b/arch/sparc/boot/Makefile @@ -6,16 +6,16 @@ ROOT_IMG := /usr/src/root.img ELFTOAOUT := elftoaout -hostprogs-y := piggyback_32 btfixupprep +hostprogs-y := piggyback btf...
1075c4ef707ca83afbeb0950094436eb0245ec86
Analyze and fix the following issue in the Linux kernel code: sparc: fix tftpboot.img for sparc64 on little-endian host
Problem Details: piggyback_32 adapted to support sparc64: - locating "HdrS" differs for sparc and sparc64 - sparc64 updates a_text, a_data + a_bss in the final a.out header Updated Makefile to use piggyback_32 for sparc64. Deleted the now unused piggyback_64.c piggyback_32.c is host endian neutral and works on both l...
```diff diff --git a/arch/sparc/boot/Makefile b/arch/sparc/boot/Makefile index 4c81fe59ab58..06a79a2018de 100644 --- a/arch/sparc/boot/Makefile +++ b/arch/sparc/boot/Makefile @@ -6,7 +6,7 @@ ROOT_IMG := /usr/src/root.img ELFTOAOUT := elftoaout -hostprogs-y := piggyback_32 piggyback_64 btfixupprep +hostprogs-y := pi...
c370e594efe2993620d24d41a78f325102e99d1c
Analyze and fix the following issue in the Linux kernel code: ARM: PL08x: fix locking between prepare function and submit function
Problem Details: The PL08x driver holds on to the channel lock with interrupts disabled between the prepare and the subsequent submit API functions. This means that the locking state when the prepare function returns is dependent on whether it suceeeds or not. It did this to ensure that the physical channel wasn't re...
```diff diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c index bf6f7d02c9f6..1c9f712520d6 100644 --- a/drivers/dma/amba-pl08x.c +++ b/drivers/dma/amba-pl08x.c @@ -981,6 +981,9 @@ static dma_cookie_t pl08x_tx_submit(struct dma_async_tx_descriptor *tx) { struct pl08x_dma_chan *plchan = to_pl08x_chan(tx...
5f638b4f313e345bf02700910e581bccf71212f5
Analyze and fix the following issue in the Linux kernel code: ARM: PL08x: fix fill_bytes calculation
Problem Details: The number of bytes we want to fill into any LLI is the minimum of: - number of bytes remaining in the transfer - number of bytes we can transfer in a single LLI - number of bytes we can transfer without overflowing the source boundary - number of bytes we can transfer without overflowing the destinati...
```diff diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c index 91dd6bfcc30f..be7fa174d6c0 100644 --- a/drivers/dma/amba-pl08x.c +++ b/drivers/dma/amba-pl08x.c @@ -685,31 +685,25 @@ static int pl08x_fill_llis_for_desc(struct pl08x_driver_data *pl08x, target_len = min(remainder, max_bytes_per_lli); ...
b61be8d728abad7fd98e62e98f22325f8f254b51
Analyze and fix the following issue in the Linux kernel code: ARM: PL08x: ensure pl08x_pre_boundary() works for any value of addr
Problem Details: pl08x_pre_boundary() was unsafe with addresses towards the top of memory space: boundary = ((addr >> PL08X_BOUNDARY_SHIFT) + 1) << PL08X_BOUNDARY_SHIFT; This can overflow a 32-bit number, producing zero. When it does: if (boundary < addr + len) return boundary - addr; else return len; re...
```diff diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c index f61940434669..7c327c315878 100644 --- a/drivers/dma/amba-pl08x.c +++ b/drivers/dma/amba-pl08x.c @@ -547,19 +547,15 @@ static void pl08x_fill_lli_for_desc(struct pl08x_driver_data *pl08x, } /* - * Return number of bytes to fill to boundar...
858c21c0f380fb9c78f47f3e372f9baadc54dffe
Analyze and fix the following issue in the Linux kernel code: ARM: PL08x: move callback outside spinlock'd region
Problem Details: Calling the callback handler with spinlocks in the tasklet held leads to deadlock when dmaengine functions are called: BUG: spinlock lockup on CPU#0, sh/417, c1870a08 Backtrace: ... [<c017b408>] (do_raw_spin_lock+0x0/0x154) from [<c02c4b98>] (_raw_spin_lock_irqsave+0x54/0x60) [<c02c4b44>] (_raw_spin_l...
```diff diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c index 986c12775b0b..660165dd945a 100644 --- a/drivers/dma/amba-pl08x.c +++ b/drivers/dma/amba-pl08x.c @@ -1540,32 +1540,29 @@ static void pl08x_tasklet(unsigned long data) { struct pl08x_dma_chan *plchan = (struct pl08x_dma_chan *) data; stru...
ad0a3ad33c96cbba98ba62116771fb836c551e60
Analyze and fix the following issue in the Linux kernel code: ARM: PL08x: remove unnecessary NULL and BUG checks
Problem Details: The tasklet always is initialized with a non-NULL data argument. It is not possible for it to be called with a NULL data argument (unless something is very wrong in the tasklet code - in which case lots of stuff will break). Therefore, as plchan can never be NULL, remove this unnecessary BUG check. ...
```diff diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c index d22d6280242d..b721ed2e884d 100644 --- a/drivers/dma/amba-pl08x.c +++ b/drivers/dma/amba-pl08x.c @@ -623,11 +623,6 @@ static int pl08x_fill_llis_for_desc(struct pl08x_driver_data *pl08x, struct lli *llis_va; struct lli *llis_bus; - if (...
9c132992689d7d27a4e17545b6279db4e03c0943
Analyze and fix the following issue in the Linux kernel code: ARM: PL08x: prefix hex numbers with 0x
Problem Details: A driver which emits both decimal and hex numbers in its printk creates confusion as to what is what. Prefix hex numbers with 0x. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
```diff diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c index 75ab4e47a153..c61774a3630e 100644 --- a/drivers/dma/amba-pl08x.c +++ b/drivers/dma/amba-pl08x.c @@ -199,8 +199,8 @@ static void pl08x_set_cregs(struct pl08x_driver_data *pl08x, ; dev_vdbg(&pl08x->adev->dev, - "WRITE channel %d: csrc=...
3e2a037c1de79af999a54581cbf1e8a5c933fd95
Analyze and fix the following issue in the Linux kernel code: ARM: PL08x: fix sparse warnings
Problem Details: drivers/dma/amba-pl08x.c:1895:40: warning: Unknown escape '%' drivers/dma/amba-pl08x.c:1903:40: warning: Unknown escape '%' drivers/dma/amba-pl08x.c:513:6: warning: symbol 'pl08x_choose_master_bus' was not declared. Should it be static? drivers/dma/amba-pl08x.c:604:5: warning: symbol 'pl08x_fill_llis_f...
```diff diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c index 4ca1eb122e07..74fa5a0f1490 100644 --- a/drivers/dma/amba-pl08x.c +++ b/drivers/dma/amba-pl08x.c @@ -510,7 +510,7 @@ static inline u32 pl08x_cctl_bits(u32 cctl, u8 srcwidth, u8 dstwidth, * this prefers the destination bus if both available ...
98838f90d92f6f0abf6d6a99880c0ff3127633b8
Analyze and fix the following issue in the Linux kernel code: ARM: PL08x: fix deadlock in terminate_all
Problem Details: Trying to disable a tasklet while holding a spinlock which the tasklet will take is a recipe for deadlock - tasklet_disable() will wait for the tasklet to finish running, which it will never do. In any case, there is not a corresponding tasklet_enable(), so once the tasklet is disabled, it will never ...
```diff diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c index 9a8d44504c6a..4ca1eb122e07 100644 --- a/drivers/dma/amba-pl08x.c +++ b/drivers/dma/amba-pl08x.c @@ -1560,8 +1560,6 @@ static int pl08x_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd, pl08x_put_phy_channel(pl08x, plchan->phychan); ...
9c0bb43bbd02fba0b235f8993d1f175734fa8735
Analyze and fix the following issue in the Linux kernel code: ARM: PL08x: fix missed spin-unlock in pl08x_issue_pending()
Problem Details: pl08x_issue_pending() returns with the spinlock locked and interrupts disabled if the channel is waiting for a physical DMA to become free. This is wrong - especially as pl08x_issue_pending() is an API function as it leads to deadlocks. Fix it to always return with the spinlock unlocked. Signed-off-b...
```diff diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c index b3b3180ce561..9a8d44504c6a 100644 --- a/drivers/dma/amba-pl08x.c +++ b/drivers/dma/amba-pl08x.c @@ -1294,15 +1294,11 @@ static void pl08x_issue_pending(struct dma_chan *chan) unsigned long flags; spin_lock_irqsave(&plchan->lock, flags)...
dafa73171be8dd31b485f5839e3376b1ca908e24
Analyze and fix the following issue in the Linux kernel code: ARM: PL08x: fix a leak when preparing TXDs
Problem Details: If we fail to allocate the LLI, the prep_* function will return NULL. However, the TXD we allocated will not be placed on any list, nor will it be freed - we'll just drop all references to it. Make sure we free it rather than leaking TXDs. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Ack...
```diff diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c index 69cfb05e4d3c..b3b3180ce561 100644 --- a/drivers/dma/amba-pl08x.c +++ b/drivers/dma/amba-pl08x.c @@ -1332,9 +1332,10 @@ static int pl08x_prep_channel_resources(struct pl08x_dma_chan *plchan, int ret; num_llis = pl08x_fill_llis_for_desc(...
bf072af461c166964fb110cfcafccd752fbb4c64
Analyze and fix the following issue in the Linux kernel code: ARM: PL08x: fix locking in tasklet
Problem Details: Tasklets are run from an interruptible context. The slave DMA functions can be called from within IRQ handlers. Taking the spinlock without disabling interrupts allows an interrupt handler to run, which may try to take the spinlock again, resulting in deadlock. Fix this by using the irqsave spinlock...
```diff diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c index 5d9a15652dba..69cfb05e4d3c 100644 --- a/drivers/dma/amba-pl08x.c +++ b/drivers/dma/amba-pl08x.c @@ -1627,11 +1627,12 @@ static void pl08x_tasklet(unsigned long data) struct pl08x_dma_chan *plchan = (struct pl08x_dma_chan *) data; struct ...
91aa5fadb831e7b6ea473a526a6b49c6dc4819ce
Analyze and fix the following issue in the Linux kernel code: ARM: PL08x: fix atomic_t usage and tx_submit() return value range
Problem Details: The last_issued variable uses an atomic type, which is only incremented inside a protected region, and then read. Everywhere else only reads the value, so it isn't using atomic_t correctly, and it doesn't even need to. Moreover, the DMA engine code provides us with a variable for this already - chan....
```diff diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c index 0809810f9e7a..5d9a15652dba 100644 --- a/drivers/dma/amba-pl08x.c +++ b/drivers/dma/amba-pl08x.c @@ -74,7 +74,6 @@ #include <asm/hardware/pl080.h> #include <asm/dma.h> #include <asm/mach/dma.h> -#include <asm/atomic.h> #include <asm/proce...
4440aacf3a171a0ab498feda58d100a320c5d9ff
Analyze and fix the following issue in the Linux kernel code: ARM: PL08x: fix array overflow in dma_set_runtime_config()
Problem Details: If maxburst was passed in as zero, we would overflow the burst_sizes[] array. Fix this by checking for this condition, and defaulting to single transfer 'bursts'. Improve the readability of the loop using a for() loop rather than a while() loop with the iterator initialized far from the loop. Signed...
```diff diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c index 3da49ed5f800..0809810f9e7a 100644 --- a/drivers/dma/amba-pl08x.c +++ b/drivers/dma/amba-pl08x.c @@ -1207,7 +1207,7 @@ static void dma_set_runtime_config(struct dma_chan *chan, u32 cctl = 0; /* Mask out all except src and dst channel */ ...
e8b5e11df3d02e7bbd85c025cc705a8e67746f73
Analyze and fix the following issue in the Linux kernel code: ARM: PL08x: fix spelling errors
Problem Details: Correct mis-spellings in comments and printk strings. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
```diff diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c index b605cc9ac3a2..3da49ed5f800 100644 --- a/drivers/dma/amba-pl08x.c +++ b/drivers/dma/amba-pl08x.c @@ -19,7 +19,7 @@ * this program; if not, write to the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston, MA 02111-1307,...
31f7aa65f536995c6d933c57230919ae408952a5
Analyze and fix the following issue in the Linux kernel code: svcrpc: modifying valid sunrpc cache entries is racy
Problem Details: Once a sunrpc cache entry is VALID, we should be replacing it (and allowing any concurrent users to destroy it on last put) instead of trying to update it in place. Otherwise someone referencing the ip_map we're modifying here could try to use the m_client just as we're putting the last reference. Th...
```diff diff --git a/net/sunrpc/svcauth_unix.c b/net/sunrpc/svcauth_unix.c index a04ac9193d59..59a7c524a8b1 100644 --- a/net/sunrpc/svcauth_unix.c +++ b/net/sunrpc/svcauth_unix.c @@ -401,8 +401,7 @@ struct auth_domain *auth_unix_lookup(struct net *net, struct in6_addr *addr) return NULL; if ((ipm->m_client->addr...
65e5341b9a0c39767ae1fecc727d70eda0dd6d83
Analyze and fix the following issue in the Linux kernel code: Btrfs: fix off by one while setting block groups readonly
Problem Details: When we read in block groups, we'll set non-redundant groups readonly if we find a raid1, DUP or raid10 group. But the ro code has an off by one bug in the math around testing to make sure out accounting doesn't go wrong. Signed-off-by: Chris Mason <chris.mason@oracle.com>
```diff diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 7e5162e5c411..b180efdc8b68 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -7971,13 +7971,14 @@ static int set_block_group_ro(struct btrfs_block_group_cache *cache) if (sinfo->bytes_used + sinfo->bytes_reserved + sinfo->b...
db98a6cfcc9ac951067c9a2cb60459b618fd7b10
Analyze and fix the following issue in the Linux kernel code: libertas: down_interruptible() can return -EINTR, not EINTR
Problem Details: Fix test in lbs_spi_thread(). down_interruptible() can return -EINTR, but not EINTR. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Cc: Dan Williams <dcbw@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
```diff diff --git a/drivers/net/wireless/libertas/if_spi.c b/drivers/net/wireless/libertas/if_spi.c index ecd4d04b2c3c..00600239a053 100644 --- a/drivers/net/wireless/libertas/if_spi.c +++ b/drivers/net/wireless/libertas/if_spi.c @@ -784,7 +784,7 @@ static int lbs_spi_thread(void *data) up(&card->spi_thread_termi...
b5c34f662a3519d34f9634a14d8de638fdbe0ca3
Analyze and fix the following issue in the Linux kernel code: mac80211: fix some key comments and code
Problem Details: The key documentation is slightly out of date, fix that. Also, the list entry in the key struct is no longer used that way, so list_del_init() isn't necessary any more there. Finally, ieee80211_key_link() is no longer invoked under RCU read lock, but rather with an appropriate station lock held. Sign...
```diff diff --git a/net/mac80211/key.c b/net/mac80211/key.c index 84cf9196820f..315ee301b75e 100644 --- a/net/mac80211/key.c +++ b/net/mac80211/key.c @@ -30,19 +30,20 @@ * keys and per-station keys. Since each station belongs to an interface, * each station key also belongs to that interface. * - * Hardware acce...
cc72128750700d01c31f583a355c5f8f809498bb
Analyze and fix the following issue in the Linux kernel code: ath9k_htc: Fix packet injection
Problem Details: To inject a packet in monitor mode, a dummy station has to be associated with the monitor interface in the target. Failing to do this would result in a firmware crash on the device. Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
```diff diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c index ad3dd3186ad2..845b4c938d16 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c @@ -235,16 +235,38 @@ err: return ret; } +static void __...
1186488b4a4d4871e40cb1604ba3ede3d4b7cc90
Analyze and fix the following issue in the Linux kernel code: ath9k: fix beacon restart on channel change
Problem Details: Restart the beacon timers only if the beacon was already configured. Otherwise beacons timers are restarted unnecessarily in unassociated state too. Cc: stable@kernel.org Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
```diff diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index 0f1b62456141..a818e4fd56f5 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c @@ -285,7 +285,8 @@ int ath_set_channel(struct ath_softc *sc, struct ieee80211_hw *hw, ath9...
ff039c6fb372c87a3cc4fd25bb846790cb35edb8
Analyze and fix the following issue in the Linux kernel code: cfg80211: fix transposition of words in printk
Problem Details: Fixes the misplaced article in the following: "cfg80211: Updating information on frequency 5785 MHz for 20 a MHz width channel with regulatory rule:" Signed-off-by: Bob Copeland <me@bobcopeland.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
```diff diff --git a/net/wireless/reg.c b/net/wireless/reg.c index 99d41831d76e..37693b6ef23a 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c @@ -752,7 +752,7 @@ static void chan_reg_rule_print_dbg(struct ieee80211_channel *chan, snprintf(max_antenna_gain, 32, "%d", power_rule->max_antenna_gain); REG_DB...
f76b57b47e5fd423f9827c7b0ba7bbd06cca6b9b
Analyze and fix the following issue in the Linux kernel code: mac80211: Fix mesh portal communication with other mesh nodes.
Problem Details: Fixed a bug where if a mesh interface has a different MAC address from its bridge interface, then it would not be able to send data traffic to any other mesh node. This also adds support for communication between mesh nodes and external bridged nodes by using a 6 address format if the source is a node ...
```diff diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index d2b4b67a7b53..11d013590166 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -1747,6 +1747,7 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, __le16 fc; struct ieee80211_hdr hdr; struct ieee80211s_hdr mesh_hdr __maybe_unused; +...
1c30cc19081c16b1fe73ac13f2cb2abc009cdcc4
Analyze and fix the following issue in the Linux kernel code: ath9k_hw: fix dma descriptor rx error bit parsing
Problem Details: An Rx DMA descriptor can have multiple error bits set, and some error bits (e.g. MIC failure) are filtered by the driver based on other criteria. Remove the 'else' in various error bit checks so that all error information is properly passed to the driver. Signed-off-by: Felix Fietkau <nbd@openwrt.org>...
```diff diff --git a/drivers/net/wireless/ath/ath9k/ar9003_mac.c b/drivers/net/wireless/ath/ath9k/ar9003_mac.c index b6e4ee48ef78..4ceddbbdfcee 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_mac.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_mac.c @@ -613,9 +613,9 @@ int ath9k_hw_process_rxdesc_edma(struct ath_hw *a...
039a07215e0fca00c450f4bf1dc9b458bdfe8559
Analyze and fix the following issue in the Linux kernel code: ath9k_htc: Fix fast channel change
Problem Details: When returning to the operating channel, a full HW reset has to be done instead of a fast channel change. Since sw_scan_complete() is called after the config() call for the home channel, we end up doing a FCC. Fix this issue by checking the OFFCHANNEL flag to determine FCC. Signed-off-by: Sujith Manoh...
```diff diff --git a/drivers/net/wireless/ath/ath9k/htc.h b/drivers/net/wireless/ath/ath9k/htc.h index 10622740dc76..34456a85ab77 100644 --- a/drivers/net/wireless/ath/ath9k/htc.h +++ b/drivers/net/wireless/ath/ath9k/htc.h @@ -331,16 +331,15 @@ void ath_htc_cancel_btcoex_work(struct ath9k_htc_priv *priv); #define OP...
ff8f59b5bbdf1527235b8c88d859c7d23691324f
Analyze and fix the following issue in the Linux kernel code: ath9k_htc: Handle pending URBs properly
Problem Details: When doing a channel change, the pending URBs have to be killed properly on calling htc_stop(). This fixes the probe response timeout seen when sending UDP traffic at a high rate and running background scan at the same time. Cc: stable <stable@kernel.org> Signed-off-by: Sujith Manoharan <Sujith.Manoh...
```diff diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c index c20c8c8201a2..5ab3084eb9cb 100644 --- a/drivers/net/wireless/ath/ath9k/hif_usb.c +++ b/drivers/net/wireless/ath/ath9k/hif_usb.c @@ -153,16 +153,36 @@ static void hif_usb_tx_cb(struct urb *urb) case -ENODEV: ...
5af3c1d195a6169a925a929e800dc4fce2a545ae
Analyze and fix the following issue in the Linux kernel code: rt2x00: Fix comment about removed spinlock
Problem Details: The comment doesn't match the code anymore. Fix that. Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
```diff diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c index b5dad0427a97..658542d2efe1 100644 --- a/drivers/net/wireless/rt2x00/rt2x00mac.c +++ b/drivers/net/wireless/rt2x00/rt2x00mac.c @@ -610,10 +610,7 @@ void rt2x00mac_bss_info_changed(struct ieee80211_hw *hw, retu...
11f16aefcc07178972f149f1a1d53e6868481394
Analyze and fix the following issue in the Linux kernel code: rt2x00: Fix panic on frame padding for rt2800 usb devices
Problem Details: Backtrace: rt2800usb_write_tx_data rt2x00queue_write_tx_frame rt2x00mac_tx invoke_tx_handlers __ieee80211_tx ieee80211_tx virt_to_head_page ieee80211_xmit ieee80211_tx_skb ieee80211_scan_work schedule ieee80211_scan_work process_one_work ... It tried to expand the skb past ...
```diff diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c index 3e0205ddf7b4..b97a4a54ff4c 100644 --- a/drivers/net/wireless/rt2x00/rt2800usb.c +++ b/drivers/net/wireless/rt2x00/rt2800usb.c @@ -369,7 +369,10 @@ static void rt2800usb_write_tx_desc(struct queue_entry *entry, ...
736e3acadce8438e610b897af2b1c472ed58444b
Analyze and fix the following issue in the Linux kernel code: rt2x00: Fix pointer errors.
Problem Details: Fix some pointer errors in the various calls to memcpy, memset and memmove. Although none of these errors are fatal (the expression used now results in the same pointer value) it is better to use the proper expression. All errors are having to deal with arrays. Signed-off-by: Gertjan van Wingerde <gw...
```diff diff --git a/drivers/net/wireless/rt2x00/rt2x00config.c b/drivers/net/wireless/rt2x00/rt2x00config.c index 70ca9379833b..e7f67d5eda52 100644 --- a/drivers/net/wireless/rt2x00/rt2x00config.c +++ b/drivers/net/wireless/rt2x00/rt2x00config.c @@ -62,13 +62,13 @@ void rt2x00lib_config_intf(struct rt2x00_dev *rt2x00d...
97e2c40269e168df986daf94af1c62e07d4fc599
Analyze and fix the following issue in the Linux kernel code: carl9170: fix usb pm suspend->resume woes
Problem Details: This patch revamps some common code-paths which are shared between (re-)initialization and suspend/resume subroutines. It also adds some helpful comments about quirks and associated difficulties. It's quite big, but it should fix #25382: <https://bugzilla.kernel.org/show_bug.cgi?id=25382> And hopeful...
```diff diff --git a/drivers/net/wireless/ath/carl9170/usb.c b/drivers/net/wireless/ath/carl9170/usb.c index 2d947a30d29e..537732e5964f 100644 --- a/drivers/net/wireless/ath/carl9170/usb.c +++ b/drivers/net/wireless/ath/carl9170/usb.c @@ -834,7 +834,7 @@ static int carl9170_usb_load_firmware(struct ar9170 *ar) if (er...