id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
6e86ccad15c01e2239da9a76cfbfbf41bbe332ba
Analyze and fix the following issue in the Linux kernel code: ARM: mach-shmobile: fix typos in sh7372 clock definitions
Problem Details: Reported-by: Magnus Damm <damm@opensource.se> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
```diff diff --git a/arch/arm/mach-shmobile/clock-sh7372.c b/arch/arm/mach-shmobile/clock-sh7372.c index 9bc6df985fc8..26521a737735 100644 --- a/arch/arm/mach-shmobile/clock-sh7372.c +++ b/arch/arm/mach-shmobile/clock-sh7372.c @@ -259,8 +259,8 @@ static struct clk mstp_clks[MSTP_NR] = { [MSTP130] = MSTP(&div4_clks[DI...
3b79becedf3c3162c9ec1c62f0a69f01b4c876a7
Analyze and fix the following issue in the Linux kernel code: ARM: mach-shmobile: fix EXTAL1 frequency on sh7372
Problem Details: EXTAL1 is clocked at 26.0MHz Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Acked-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
```diff diff --git a/arch/arm/mach-shmobile/clock-sh7372.c b/arch/arm/mach-shmobile/clock-sh7372.c index 241caea32260..9bc6df985fc8 100644 --- a/arch/arm/mach-shmobile/clock-sh7372.c +++ b/arch/arm/mach-shmobile/clock-sh7372.c @@ -60,7 +60,7 @@ static struct clk r_clk = { * If needed, reset this with clk_set_rate() f...
748cce431eb413e794c8f1d1974b78b47a6174ef
Analyze and fix the following issue in the Linux kernel code: ALSA: hda - Fix initial capsrc selection in patch_alc269()
Problem Details: In patch_alc269(), we initialize the primary capsrc so that the device works from the beginning. It issues CONNECT_SEL verb no matter which widget is although some widget (e.g. 0x23) has no connection selection but a mixer, which requires unmuting instead. This patch fixes the initialization of capsr...
```diff diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 6c588ef26685..c8070620a4d8 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -5166,6 +5166,19 @@ static void fixup_automic_adc(struct hda_codec *codec) spec->auto_mic = 0; /* disable auto-mic to be...
f1c2c19c498e27de48bf0dc4221e6e31b1823169
Analyze and fix the following issue in the Linux kernel code: memblock: Fix memblock_is_region_reserved() to return a boolean
Problem Details: All callers expect a boolean result which is true if the region overlaps a reserved region. However, the implementation actually returns -1 if there is no overlap, and a region index (0 based) if there is. Make it behave as callers (and common sense) expect. Signed-off-by: Benjamin Herrenschmidt <ben...
```diff diff --git a/mm/memblock.c b/mm/memblock.c index 3024eb30fc27..43840b305ecb 100644 --- a/mm/memblock.c +++ b/mm/memblock.c @@ -504,7 +504,7 @@ int __init memblock_is_reserved(u64 addr) int memblock_is_region_reserved(u64 base, u64 size) { - return memblock_overlaps_region(&memblock.reserved, base, size); + ...
d05dd4e98f0dd30ee933e05ac9363614c47df83a
Analyze and fix the following issue in the Linux kernel code: NFS: Fix the NFS users of rpc_restart_call()
Problem Details: Fix up those functions that depend on knowing whether or not rpc_restart_call is successful or not. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
```diff diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h index d8bd619e386c..699725fee34f 100644 --- a/fs/nfs/internal.h +++ b/fs/nfs/internal.h @@ -369,10 +369,9 @@ unsigned int nfs_page_array_len(unsigned int base, size_t len) * Helper for restarting RPC calls in the possible presence of NFSv4.1 * sessions. *...
14516c3a30e256e8d4e7a9af271c8df644ac3222
Analyze and fix the following issue in the Linux kernel code: NFSv4.1: Handle NFS4ERR_DELAY on SEQUENCE correctly
Problem Details: In RFC5661, an NFS4ERR_DELAY error on a SEQUENCE operation has the special meaning that the server is not finished processing the request. In this case we want to just retry the request without touching the slot. Also fix a bug whereby we would fail to update the sequence id if the server returned any...
```diff diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index d6413b48b057..cab0eb915145 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -389,11 +389,12 @@ static void nfs41_sequence_free_slot(struct nfs4_sequence_res *res) res->sr_slotid = NFS4_MAX_SLOT_TABLE; } -static void nfs41_sequence_done(struc...
af7fa16506bf9b6323e862a61e14c20555152bb3
Analyze and fix the following issue in the Linux kernel code: NFS: Fix up the fsync code
Problem Details: Christoph points out that the VFS will always flush out data before calling nfs_fsync(), so we can dispense with a full call to nfs_wb_all(), and replace that with a simpler call to nfs_commit_inode(). Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
```diff diff --git a/fs/nfs/file.c b/fs/nfs/file.c index 36a5e74f51b4..f36581cd4767 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c @@ -201,38 +201,12 @@ static loff_t nfs_file_llseek(struct file *filp, loff_t offset, int origin) return loff; } -/* - * Helper for nfs_file_flush() and nfs_file_fsync() - * - * Notice...
dc77de12dde95c8da39e4c417eb70c7d445cf84b
Analyze and fix the following issue in the Linux kernel code: drm/radeon: tone down overchatty acpi debug messages.
Problem Details: On non laptop systems we'll see these the whole time, so make them less important. Signed-off-by: Dave Airlie <airlied@redhat.com>
```diff diff --git a/drivers/gpu/drm/radeon/radeon_acpi.c b/drivers/gpu/drm/radeon/radeon_acpi.c index e366434035cb..3f6636bb2d7f 100644 --- a/drivers/gpu/drm/radeon/radeon_acpi.c +++ b/drivers/gpu/drm/radeon/radeon_acpi.c @@ -35,7 +35,7 @@ static int radeon_atif_call(acpi_handle handle) /* Fail only if calling the...
d65d65b175a29bd7ea2bb69c046419329c4a5db7
Analyze and fix the following issue in the Linux kernel code: drm/radeon/kms: fix calculation of h/v scaling factors
Problem Details: Prior to this patch the code was dividing the src_v by the dst_h and vice versa, rather than src_v/dst_v and src_h/dst_h. This could lead to problems in the calculation of the display watermarks. Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
```diff diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c index 283beedc2cbf..12a54145b64a 100644 --- a/drivers/gpu/drm/radeon/radeon_display.c +++ b/drivers/gpu/drm/radeon/radeon_display.c @@ -1073,11 +1073,13 @@ bool radeon_crtc_scaling_mode_fixup(struct drm_crtc *crtc, ...
e06b14ee91a2ddefc9a67443a6cd8ee0fa800115
Analyze and fix the following issue in the Linux kernel code: drm/radeon/kms: handle the case of no active displays properly in the bandwidth code
Problem Details: Logic was: if (mode0 && mode1) else if (mode0) else Should be: if (mode0 && mode1) else if (mode0) else if (mode1) Otherwise we may end up calculating the priority regs with unitialized values. Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=16492 Signed-off-by: Alex Deucher <alexdeucher@gmail.c...
```diff diff --git a/drivers/gpu/drm/radeon/rs690.c b/drivers/gpu/drm/radeon/rs690.c index f3a8c9344c64..6fbb874583f4 100644 --- a/drivers/gpu/drm/radeon/rs690.c +++ b/drivers/gpu/drm/radeon/rs690.c @@ -398,7 +398,9 @@ void rs690_bandwidth_update(struct radeon_device *rdev) struct drm_display_mode *mode1 = NULL; st...
bda7d2a862e6b788bca2d02d38a07966a9c92e48
Analyze and fix the following issue in the Linux kernel code: ASoC: TWL4030: Capture route runtime DAPM ordering fix
Problem Details: Fix the ordering problem in DAPM domain, when the user changes between digital and analog sources during active capture (or loopback) scenario. Before this patch, when the user changed from analog source to digital there were a short time, when the codec enabled analog mic bias (2.2 volts) instead of t...
```diff diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c index d401c597d38f..7b618bbff884 100644 --- a/sound/soc/codecs/twl4030.c +++ b/sound/soc/codecs/twl4030.c @@ -577,36 +577,6 @@ static const struct snd_kcontrol_new twl4030_dapm_dbypassv_control = TWL4030_REG_VSTPGA, 0, 0x29, 0, twl4030...
a5210c12b7c4e34e904f4820a4abd048a2d75db5
Analyze and fix the following issue in the Linux kernel code: IB/qib: Fix race between qib_error_qp() and receive packet processing
Problem Details: When transitioning a QP to the error state, in progress RWQEs need to be marked complete. This also involves releasing the reference count to the memory regions referenced in the SGEs. The locking in the receive packet processing wasn't sufficient to prevent qib_error_qp() from modifying the r_sge st...
```diff diff --git a/drivers/infiniband/hw/qib/qib_qp.c b/drivers/infiniband/hw/qib/qib_qp.c index e0f65e39076b..6c39851d2ded 100644 --- a/drivers/infiniband/hw/qib/qib_qp.c +++ b/drivers/infiniband/hw/qib/qib_qp.c @@ -450,7 +450,7 @@ static void clear_mr_refs(struct qib_qp *qp, int clr_sends) * * Flushes both send...
b29230769e3482bbd62a07d6d9485371ee66a18f
Analyze and fix the following issue in the Linux kernel code: um: Fix read_persistent_clock fallout
Problem Details: commit 9f31f57(um: Convert to use read_persistent_clock) moved the code, but not the variable. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
```diff diff --git a/arch/um/kernel/time.c b/arch/um/kernel/time.c index 2b8b262e5c23..a08d9fab81f2 100644 --- a/arch/um/kernel/time.c +++ b/arch/um/kernel/time.c @@ -104,15 +104,14 @@ static void __init setup_itimer(void) void read_persistent_clock(struct timespec *ts) { - nsecs = os_nsecs(); + long long nsecs = o...
307069cf6c53632adc27de4f49bf5d1d67cb87bb
Analyze and fix the following issue in the Linux kernel code: [CPUFREQ] Fix section mismatch for powernow_cpu_init in powernow-k7.c
Problem Details: Use __cpuinit instead of __init for the cpufreq_driver init function like it is done in powernow-k8.c. This is removing the warning generated when compiling with the CONFIG_DEBUG_SECTION_MISMATCH=y option. Signed-off-by: Holger Hans Peter Freyther <holger@moiji-mobile.com> Signed-off-by: Dave Jones <...
```diff diff --git a/arch/x86/kernel/cpu/cpufreq/powernow-k7.c b/arch/x86/kernel/cpu/cpufreq/powernow-k7.c index 9a97116f89e5..4a45fd6e41ba 100644 --- a/arch/x86/kernel/cpu/cpufreq/powernow-k7.c +++ b/arch/x86/kernel/cpu/cpufreq/powernow-k7.c @@ -569,7 +569,7 @@ static int powernow_verify(struct cpufreq_policy *policy)...
2530573e45c5846cd238db78651f0d236fc78aab
Analyze and fix the following issue in the Linux kernel code: [CPUFREQ] Fix section mismatch for longhaul_cpu_init.
Problem Details: Use __cpuinit instead of __init for the cpufreq_driver init function like it is done in powernow-k8.c. Use the __cpuinitdata for data used by the routines marked as __cpuinit. This is removing the warning generated when compiling with the CONFIG_DEBUG_SECTION_MISMATCH=y option. Signed-off-by: Holger ...
```diff diff --git a/arch/x86/kernel/cpu/cpufreq/longhaul.c b/arch/x86/kernel/cpu/cpufreq/longhaul.c index 7e7eea4f8261..03162dac6271 100644 --- a/arch/x86/kernel/cpu/cpufreq/longhaul.c +++ b/arch/x86/kernel/cpu/cpufreq/longhaul.c @@ -426,7 +426,7 @@ static int guess_fsb(int mult) } -static int __init longhaul_get...
7e2d81122052c83feeddbebf706b6d53fba7996d
Analyze and fix the following issue in the Linux kernel code: [CPUFREQ] Fix section mismatch for longrun_cpu_init.
Problem Details: Use __cpuinit instead of __init for the cpufreq_driver init function like it is done in powernow-k8.c. This is removing the warning generated when compiling with the CONFIG_DEBUG_SECTION_MISMATCH=y option. Signed-off-by: Holger Hans Peter Freyther <holger@moiji-mobile.com> Signed-off-by: Dave Jones <...
```diff diff --git a/arch/x86/kernel/cpu/cpufreq/longrun.c b/arch/x86/kernel/cpu/cpufreq/longrun.c index e7b559d74c52..fc09f142d94d 100644 --- a/arch/x86/kernel/cpu/cpufreq/longrun.c +++ b/arch/x86/kernel/cpu/cpufreq/longrun.c @@ -165,8 +165,8 @@ static unsigned int longrun_get(unsigned int cpu) * TMTA rules: * per...
b30d3304c9c068ccfe6940232834768af75f8c9a
Analyze and fix the following issue in the Linux kernel code: [CPUFREQ] powernow-k8: Fix misleading variable naming
Problem Details: rdmsr() takes the lower 32 bits as a second argument and the high 32 as a third. Fix the names accordingly since they were swapped. There should be no functionality change resulting from this patch. Signed-off-by: Borislav Petkov <borislav.petkov@amd.com> Signed-off-by: Dave Jones <davej@redhat.com>
```diff diff --git a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c index c48b44b3b43a..90cab2d4ac0d 100644 --- a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c +++ b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c @@ -912,8 +912,8 @@ static int fill_powernow_table_pstate(struct powernow_k8_...
9c36f746d7e191ad6f44f01859af843f0c4d3c5d
Analyze and fix the following issue in the Linux kernel code: [CPUFREQ] fix brace coding style issue.
Problem Details: This patch fixes up a brace warning found by the checkpatch.pl tool Signed-off-by: Neal Buckendahl <nealb001@tbcnet.com> Signed-off-by: Dave Jones <davej@redhat.com>
```diff diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 6ce1bb735635..199dcb9f0b83 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -1876,8 +1876,7 @@ static int __cpuinit cpufreq_cpu_callback(struct notifier_block *nfb, return NOTIFY_OK; } -static struct notifier_...
6f4f2723d08534fd4e407e1ef8500b0f4d12c30c
Analyze and fix the following issue in the Linux kernel code: [CPUFREQ] x86 cpufreq: Make trace_power_frequency cpufreq driver independent
Problem Details: and fix the broken case if a core's frequency depends on others. trace_power_frequency was only implemented in a rather ungeneric way in acpi-cpufreq driver's target() function only. -> Move the call to trace_power_frequency to cpufreq.c:cpufreq_notify_transition() where CPUFREQ_POSTCHANGE notif...
```diff diff --git a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c index cee7aa949c35..246cd3afbb5f 100644 --- a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c +++ b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c @@ -34,7 +34,6 @@ #include <linux/compiler.h> #include <linux/dmi.h> #...
6b72e3934b42930fd40fc42fe762d21be413301c
Analyze and fix the following issue in the Linux kernel code: [CPUFREQ] acpi-cpufreq: Fix CPU_ANY CPUFREQ_{PRE,POST}CHANGE notification
Problem Details: Signed-off-by: Thomas Renninger <trenn@suse.de> CC: venki@google.com CC: davej@redhat.com CC: arjan@infradead.org CC: linux-kernel@vger.kernel.org Signed-off-by: Dave Jones <davej@redhat.com>
```diff diff --git a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c index 1d3cddaa40ee..cee7aa949c35 100644 --- a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c +++ b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c @@ -351,7 +351,7 @@ static int acpi_cpufreq_target(struct cpufreq_policy ...
a665df9d510bfd5bac5664f436411f921471264a
Analyze and fix the following issue in the Linux kernel code: [CPUFREQ] ondemand: don't synchronize sample rate unless multiple cpus present
Problem Details: For UP systems this is not required, and results in a more consistent sample interval. [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Jocelyn Falempe <jocelyn.falempe@motorola.com> Signed-off-by: Mike Chan <mike@android.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Sign...
```diff diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c index fecfcdda6ddd..7b5093664e49 100644 --- a/drivers/cpufreq/cpufreq_ondemand.c +++ b/drivers/cpufreq/cpufreq_ondemand.c @@ -609,7 +609,9 @@ static void do_dbs_timer(struct work_struct *work) /* We want all CPUs to do sampli...
298decfbc44e9a4cb7862ae1b7dfc4e1ba3551b9
Analyze and fix the following issue in the Linux kernel code: [CPUFREQ] powernow-k8: On load failure, remind the user to enable support in BIOS setup
Problem Details: On Wed, 2010-01-20 at 16:56 +0100, Thomas Renninger wrote: > But most often this happens if people upgrade their CPU and do not > update their BIOS. > Or the vendor does not recognise the new CPU even if the BIOS got > updated. Maybe some of those people just didn't realize it was disabled in BIOS? If...
```diff diff --git a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c index 3e90cce3dc8b..c48b44b3b43a 100644 --- a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c +++ b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c @@ -806,6 +806,8 @@ static int find_psb_table(struct powernow_k8_data *data) ...
6ebdf777ba034d2b54c99f28a4b18dabf286d8e5
Analyze and fix the following issue in the Linux kernel code: [CPUFREQ] Fix PCC driver error path
Problem Details: The PCC cpufreq driver unmaps the mailbox address range if any CPUs fail to initialise, but doesn't do anything to remove the registered CPUs from the cpufreq core resulting in failures further down the line. We're better off simply returning a failure - the cpufreq core will unregister us cleanly if w...
```diff diff --git a/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c b/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c index 900702888bfb..a36de5bbb622 100644 --- a/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c +++ b/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c @@ -541,13 +541,13 @@ static int pcc_cpufreq_cpu_init(struct cpufreq_policy *...
0d9715d64fe118dd0957a29e344972b8d3f960e7
Analyze and fix the following issue in the Linux kernel code: [CPUFREQ] fix double freeing in error path of pcc-cpufreq
Problem Details: Prevent double freeing on error path. Signed-off-by: Daniel J Blueman <daniel.blueman@gmail.com> Signed-off-by: Dave Jones <davej@redhat.com>
```diff diff --git a/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c b/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c index 01bd25c3c7ca..900702888bfb 100644 --- a/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c +++ b/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c @@ -368,22 +368,16 @@ static int __init pcc_cpufreq_do_osc(acpi_handle *handl...
cad70a6ae5aaef4641a3efdfd536c30f13891afe
Analyze and fix the following issue in the Linux kernel code: [CPUFREQ] fix memory leak in cpufreq_add_dev
Problem Details: We didn't free policy->related_cpus in error path err_unlock_policy. This is catched by following kmemleak report: unreferenced object 0xffff88022a0b96d0 (size 512): comm "modprobe", pid 886, jiffies 4294689177 (age 780.694s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 00 00 00 00 00 00...
```diff diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 8f22ce1ea684..938b74ea9ffb 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -1077,6 +1077,7 @@ err_out_unregister: err_unlock_policy: unlock_policy_rwsem_write(cpu); + free_cpumask_var(policy->related_cpus); ...
ffe6275f90cc2ea77e6120a510903687be067b16
Analyze and fix the following issue in the Linux kernel code: [CPUFREQ] revert "[CPUFREQ] remove rwsem lock from CPUFREQ_GOV_STOP call (second call site)"
Problem Details: 395913d0b1db37092ea3d9d69b832183b1dd84c5 ("[CPUFREQ] remove rwsem lock from CPUFREQ_GOV_STOP call (second call site)") is not needed, because there is no rwsem lock in cpufreq_ondemand and cpufreq_conservative anymore. Lock should not be released until the work done. Addresses https://bugzilla.kernel...
```diff diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 063b2184caf5..8f22ce1ea684 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -1762,17 +1762,8 @@ static int __cpufreq_set_policy(struct cpufreq_policy *data, dprintk("governor switch\n"); /* end old govern...
4b4fd27c0b5ec638a1f06ced9226fd95229dbbf0
Analyze and fix the following issue in the Linux kernel code: PARISC: led.c - fix potential stack overflow in led_proc_write()
Problem Details: avoid potential stack overflow by correctly checking count parameter Reported-by: Ilja <ilja@netric.org> Signed-off-by: Helge Deller <deller@gmx.de> Acked-by: Kyle McMartin <kyle@mcmartin.ca> Cc: James E.J. Bottomley <jejb@parisc-linux.org> Cc: stable@kernel.org Signed-off-by: Linus Torvalds <torvalds...
```diff diff --git a/drivers/parisc/led.c b/drivers/parisc/led.c index 188bc8496a26..d02be78a4138 100644 --- a/drivers/parisc/led.c +++ b/drivers/parisc/led.c @@ -176,16 +176,18 @@ static ssize_t led_proc_write(struct file *file, const char *buf, size_t count, loff_t *pos) { void *data = PDE(file->f_path.dentry->d...
127c03cdbad9bd5af5d7f33bd31a1015a90cb77f
Analyze and fix the following issue in the Linux kernel code: pcmcia: avoid buffer overflow in pcmcia_setup_isa_irq
Problem Details: NR_IRQS may be as low as 16, causing a (harmless?) buffer overflow in pcmcia_setup_isa_irq(): static u8 pcmcia_used_irq[NR_IRQS]; ... if ((try < 32) && pcmcia_used_irq[irq]) continue; This is read-only, so if this address would be non-zero, it would just mean we would not attempt an IRQ >= NR_...
```diff diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c index d48437f83acf..54aa1c238cb3 100644 --- a/drivers/pcmcia/pcmcia_resource.c +++ b/drivers/pcmcia/pcmcia_resource.c @@ -677,7 +677,7 @@ EXPORT_SYMBOL(__pcmcia_request_exclusive_irq); #ifdef CONFIG_PCMCIA_PROBE /* mask of IRQs...
eba042a81edd6baaff44831b2d719b14a6d21e58
Analyze and fix the following issue in the Linux kernel code: edac, mc: Improve scrub rate handling
Problem Details: Fortify the interface to not accept negative values, remove memctrl_int_store() as a result. Also, sanitize bandwidth setting by making the argument a simple u32 instead of strange u32 pointer being passed around for no obvious reason. Then, fix error handling and teach it to return proper error values...
```diff diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c index cdf457925f03..0106d343a681 100644 --- a/drivers/edac/amd64_edac.c +++ b/drivers/edac/amd64_edac.c @@ -160,7 +160,7 @@ static int amd64_search_set_scrub_rate(struct pci_dev *ctl, u32 new_bw, return 0; } -static int amd64_set_scrub_rate...
9975a5f22a4fcc8d08035c65439900a983f891ad
Analyze and fix the following issue in the Linux kernel code: amd64_edac: Fix DCT base address selector
Problem Details: The correct check is to verify whether in high range we're below 4GB and not to extract the DctSelBaseAddr again. See "2.8.5 Routing DRAM Requests" in the F10h BKDG. Cc: <stable@kernel.org> # .32.x .33.x .34.x Signed-off-by: Borislav Petkov <borislav.petkov@amd.com> Acked-by: Doug Thompson <dougthomps...
```diff diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c index a44e90abb755..4129aa0930cd 100644 --- a/drivers/edac/amd64_edac.c +++ b/drivers/edac/amd64_edac.c @@ -1435,7 +1435,7 @@ static inline u64 f10_get_base_addr_offset(u64 sys_addr, int hi_range_sel, u64 chan_off; if (hi_range_sel) { - i...
935ab88e341ccb1507b2b0b1f1e9adcbbd693265
Analyze and fix the following issue in the Linux kernel code: edac: Remove EDAC_DEBUG_VERBOSE
Problem Details: This option differs from EDAC_DEBUG only by printing the file and line of where the debug statement is placed, which contains unneeded information. So remove it. Signed-off-by: Borislav Petkov <borislav.petkov@amd.com> Acked-by: Doug Thompson <dougthompson@xmission.com>
```diff diff --git a/drivers/edac/Kconfig b/drivers/edac/Kconfig index 0d2f9dbb47e4..70bb350de996 100644 --- a/drivers/edac/Kconfig +++ b/drivers/edac/Kconfig @@ -39,14 +39,6 @@ config EDAC_DEBUG there're four debug levels (x=0,1,2,3 from low to high). Usually you should select 'N'. -config EDAC_DEBUG_VERBOSE...
ad6a32e96939a0eb0eb382e7d78dbf33457aed1a
Analyze and fix the following issue in the Linux kernel code: amd64_edac: Sanitize syndrome extraction
Problem Details: Remove the two syndrome extraction macros and add a single function which does the same thing but with proper typechecking. While at it, make sure to cache ECC syndrome size and dump it in debug output. Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
```diff diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c index ac9f7985096d..e8d84f89dbcf 100644 --- a/drivers/edac/amd64_edac.c +++ b/drivers/edac/amd64_edac.c @@ -796,6 +796,11 @@ static int sys_addr_to_csrow(struct mem_ctl_info *mci, u64 sys_addr) static int get_channel_from_ecc_syndrome(struct ...
5aa06930fbcfcb6b03fcb18b753122b10ac47a87
Analyze and fix the following issue in the Linux kernel code: intel_scu_ipc: fix size field for intel_scu_ipc_command
Problem Details: Size for PMIC read/write command is byte, while it is DWORD for other IPC commands. Signed-off-by: Hong Liu <hong.liu@intel.com> Signed-off-by: ALan Cox <alan@linux.intel.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
```diff diff --git a/drivers/platform/x86/intel_scu_ipc.c b/drivers/platform/x86/intel_scu_ipc.c index 23b6d46a4b8f..943f9084dcb1 100644 --- a/drivers/platform/x86/intel_scu_ipc.c +++ b/drivers/platform/x86/intel_scu_ipc.c @@ -444,7 +444,7 @@ int intel_scu_ipc_command(int cmd, int sub, u32 *in, int inlen, for (i = 0;...
215c330fe92be8d9f74bc292ea085dbe2ace6bf5
Analyze and fix the following issue in the Linux kernel code: intel_scu_ipc: fix data packing of PMIC command on Moorestown
Problem Details: Data is 2-byte per entry for PMIC read-modify-update command. Signed-off-by: Hong Liu <hong.liu@intel.com> Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
```diff diff --git a/drivers/platform/x86/intel_scu_ipc.c b/drivers/platform/x86/intel_scu_ipc.c index 5055c523c5e2..84a2d4bfdec8 100644 --- a/drivers/platform/x86/intel_scu_ipc.c +++ b/drivers/platform/x86/intel_scu_ipc.c @@ -154,7 +154,7 @@ static inline int busy_loop(void) /* Wait till scu status is busy */ /* Read...
51cd525dce018f298568d8e2e769b1a698ef91cd
Analyze and fix the following issue in the Linux kernel code: Fix stack buffer size for IPC writev messages
Problem Details: The stack buffer for IPC messages was 16 bytes, limiting messages to a size of 4 (each message is 32 bit). However, the touch screen driver is trying to send messages of size 5.... (AC: Set to 20 bytes having checked the max size allowed) Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Signed...
```diff diff --git a/drivers/platform/x86/intel_scu_ipc.c b/drivers/platform/x86/intel_scu_ipc.c index 5258749138d6..1b0d0d54cb0f 100644 --- a/drivers/platform/x86/intel_scu_ipc.c +++ b/drivers/platform/x86/intel_scu_ipc.c @@ -58,8 +58,8 @@ #define IPC_BASE_ADDR 0xFF11C000 /* IPC1 base register address */ #defi...
500de3dd46ac9f9ae9d124634c68907b7d50d2cb
Analyze and fix the following issue in the Linux kernel code: acpi ec_sys: Be more cautious about ec write access
Problem Details: - Set Kconfig option default n - Only allow root to read/write io file (sever bug!) - Introduce write support module param -> default off - Properly clean up if any debugfs files cannot be created Signed-off-by: Thomas Renninger <trenn@suse.de> CC: mjg59@srcf.ucam.org CC: platform-driver-x86@vger.kern...
```diff diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index f7226d1bc80e..08e0140920e1 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig @@ -106,14 +106,19 @@ config ACPI_SYSFS_POWER config ACPI_EC_DEBUGFS tristate "EC read/write access through /sys/kernel/debug/ec" - default y + default n ...
de4f10466e9347a2f1bfe39e501539557bed2c4b
Analyze and fix the following issue in the Linux kernel code: acpi ec: Fix possible double io port registration
Problem Details: which will result in a harmless but ugly WARN message on some machines. Signed-off-by: Thomas Renninger <trenn@suse.de> CC: mjg59@srcf.ucam.org CC: platform-driver-x86@vger.kernel.org CC: linux-acpi@vger.kernel.org CC: astarikovskiy@suse.de CC: akpm@linux-foundation.org Signed-off-by: Matthew Garrett ...
```diff diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index 265a99c1eb14..1fa0aafebe2a 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c @@ -818,6 +818,12 @@ static int acpi_ec_add(struct acpi_device *device) if (!first_ec) first_ec = ec; device->driver_data = ec; + + WARN(!request_region(ec->data_addr...
c4775062d57c762de37ff93fb5f8611320c25e2a
Analyze and fix the following issue in the Linux kernel code: hp-wmi: Fix mixing up of and/or directive
Problem Details: This should have been an "and". Additionally checking for !obj is even better. Signed-off-by: Thomas Renninger <trenn@suse.de> CC: linux-acpi@vger.kernel.or CC: platform-driver-x86@vger.kernel.org CC: mjg@redhat.com Signed-off-by: Matthew Garrett <mjg@redhat.com>
```diff diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c index c5f95d1e0315..7e8a136b025b 100644 --- a/drivers/platform/x86/hp-wmi.c +++ b/drivers/platform/x86/hp-wmi.c @@ -434,7 +434,9 @@ static void hp_wmi_notify(u32 value, void *context) obj = (union acpi_object *)response.pointer; - ...
45036ae14a0161e9a0f542b6cb7ed55790f73f5b
Analyze and fix the following issue in the Linux kernel code: asus-laptop: fix asus_input_init error path
Problem Details: This patch includes below fixes: 1. return -ENOMEM instead of 0 if input_allocate_device fail. 2. fix wrong goto if sparse_keymap_setup fail. 3. fix wrong goto if input_register_device fail. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
```diff diff --git a/drivers/platform/x86/asus-laptop.c b/drivers/platform/x86/asus-laptop.c index 6aba24618416..b756e07d41b4 100644 --- a/drivers/platform/x86/asus-laptop.c +++ b/drivers/platform/x86/asus-laptop.c @@ -1124,7 +1124,7 @@ static int asus_input_init(struct asus_laptop *asus) input = input_allocate_devic...
8950778704cf8483cc5cc0140f557adf0d3f45a5
Analyze and fix the following issue in the Linux kernel code: gpio: Add PMIC GPIO block support
Problem Details: Moorestown has PMIC chip which contains GPIO blocks. The PMIC chip is connected to Langwell by SPI interface. So this GPIO driver will be regarded as SPI GPIO expander though the actual GPIO access is through IPC and SRAM. The SPI master contoller will probe this device driver by parsing SPIB table. C...
```diff diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig index 2189565d9e0e..ca30e561859e 100644 --- a/drivers/platform/x86/Kconfig +++ b/drivers/platform/x86/Kconfig @@ -540,6 +540,13 @@ config INTEL_SCU_IPC some embedded Intel x86 platforms. This is not needed for PC-type machines. +...
9827886dce77c47c378ce3154689cea2c45c731d
Analyze and fix the following issue in the Linux kernel code: ACPI: Provide /sys/kernel/debug//ec/ec0/io for binary access to the EC
Problem Details: A userspace app to easily read/write the EC can be found here: ftp://ftp.suse.com/pub/people/trenn/sources/ec/ec_access.c Multiple ECs are not supported, but shouldn't be hard to add as soon as the ec driver itself will support them. Signed-off-by: Thomas Renninger <trenn@suse.de> CC: Alexey Starikov...
```diff diff --git a/drivers/acpi/ec_sys.c b/drivers/acpi/ec_sys.c index 834c21a42d67..3ef978185c73 100644 --- a/drivers/acpi/ec_sys.c +++ b/drivers/acpi/ec_sys.c @@ -1,3 +1,13 @@ +/* + * ec_sys.c + * + * Copyright (C) 2010 SUSE Products GmbH/Novell + * Author: + * Thomas Renninger <trenn@suse.de> + * + * This wor...
1195a098168fcacfef1cd80d05358e52fb366bf6
Analyze and fix the following issue in the Linux kernel code: ACPI: Provide /sys/kernel/debug/ec/...
Problem Details: This patch provides the same information through debugfs, which previously was provided through /proc/acpi/embedded_controller/*/info This is the gpe the EC is connected to and whether the global lock gets used. The io ports used are added to /proc/ioports in another patch. Beside the fact that /proc/...
```diff diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index 746411518802..f7226d1bc80e 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig @@ -104,6 +104,19 @@ config ACPI_SYSFS_POWER help Say N to disable power /sys interface +config ACPI_EC_DEBUGFS + tristate "EC read/write access through ...
cd89e08fa020f5a882f922e3c9e2628235ca6715
Analyze and fix the following issue in the Linux kernel code: Documentation: Add new /sys/kernel/debug/ec/* files to ABI
Problem Details: Signed-off-by: Thomas Renninger <trenn@suse.de> CC: Alexey Starikovskiy <astarikovskiy@suse.de> CC: Len Brown <lenb@kernel.org> CC: linux-kernel@vger.kernel.org CC: linux-acpi@vger.kernel.org CC: platform-driver-x86@vger.kernel.org Signed-off-by: Matthew Garrett <mjg@redhat.com>
```diff diff --git a/Documentation/ABI/testing/debugfs-ec b/Documentation/ABI/testing/debugfs-ec new file mode 100644 index 000000000000..6546115a94da --- /dev/null +++ b/Documentation/ABI/testing/debugfs-ec @@ -0,0 +1,20 @@ +What: /sys/kernel/debug/ec/*/{gpe,use_global_lock,io} +Date: July 2010 +Contact: Thomas Renn...
925b108918c9a2ac58b4fd0994f4a9e63e11521c
Analyze and fix the following issue in the Linux kernel code: X86 platform driver: Fix section mismatch in wmi.c
Problem Details: The .add function must not be declared __init. Signed-off-by: Thomas Renninger <trenn@suse.de> CC: Alexey Starikovskiy <astarikovskiy@suse.de> CC: Len Brown <lenb@kernel.org> CC: linux-kernel@vger.kernel.org CC: linux-acpi@vger.kernel.org CC: platform-driver-x86@vger.kernel.org Signed-off-by: Matthew...
```diff diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c index 6c15720be6a4..b2978a04317f 100644 --- a/drivers/platform/x86/wmi.c +++ b/drivers/platform/x86/wmi.c @@ -810,7 +810,7 @@ static bool guid_already_parsed(const char *guid_string) /* * Parse the _WDG method for the GUID data blocks */ ...
a420e46412ad9d33c7174cd4311b91728122e2c4
Analyze and fix the following issue in the Linux kernel code: X86 platform drivers: Remove EC dump from thinkpad_acpi
Problem Details: There is a general interface for that now (provided by other patches in this patch series): /sys/kernel/debug/ec/*/io Signed-off-by: Thomas Renninger <trenn@suse.de> CC: Alexey Starikovskiy <astarikovskiy@suse.de> CC: Len Brown <lenb@kernel.org> CC: linux-kernel@vger.kernel.org CC: linux-acpi@vger.ke...
```diff diff --git a/Documentation/laptops/thinkpad-acpi.txt b/Documentation/laptops/thinkpad-acpi.txt index fc15538d8b46..f6f80257addb 100644 --- a/Documentation/laptops/thinkpad-acpi.txt +++ b/Documentation/laptops/thinkpad-acpi.txt @@ -960,70 +960,21 @@ Sysfs notes: subsystem, and follow all of the hwmon guideline...
9fab10cdf58099beff08d74f6b4a6633305c5754
Analyze and fix the following issue in the Linux kernel code: panasonic-laptop: fix acpi_pcc_write_sset return value
Problem Details: In current implementation, acpi_pcc_write_sset return 1 if write is successful, 0 if write is failed. But all the callers consider acpi_pcc_write_sset return 0 if write is successful and return negtive if write is failed. This patch changes the implementation of acpi_pcc_write_sset to return 0 if writ...
```diff diff --git a/drivers/platform/x86/panasonic-laptop.c b/drivers/platform/x86/panasonic-laptop.c index 2fb9a32926f8..ec01c3d8fc5a 100644 --- a/drivers/platform/x86/panasonic-laptop.c +++ b/drivers/platform/x86/panasonic-laptop.c @@ -248,7 +248,7 @@ static int acpi_pcc_write_sset(struct pcc_acpi *pcc, int func, in...
bfa47960f957c021a4d626b051668d2f66cadf23
Analyze and fix the following issue in the Linux kernel code: eeepc-laptop: fix hotplug_disabled module_param permissions
Problem Details: The hotplug_disabled module parameter is determinated at the module load time. Change the value after the module is loaded does not make sense and has no effect at all, thus set the permissions to 0444 instead of 0644. Signed-off-by: Axel Lin <axel.lin@gmail.com> Cc: Corentin Chary <corentincj@iksaif...
```diff diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c index 0306174ba875..6b8e06206c46 100644 --- a/drivers/platform/x86/eeepc-laptop.c +++ b/drivers/platform/x86/eeepc-laptop.c @@ -53,7 +53,7 @@ MODULE_LICENSE("GPL"); static bool hotplug_disabled; -module_param(hotplug_dis...
c26d85cb90e178d1e3df6a78d064f8731f154a5e
Analyze and fix the following issue in the Linux kernel code: asus-laptop: fix wapf, wlan_status and bluetooth_status module_param permissions
Problem Details: The wapf module parameters defines the behavior of the Fn+Fx wlan key. The wlan_status and bluetooth_status module parameters are for setting the wlan/bluetooth status on boot. All above module parameters are determinated only at the module load time. Change the value after the module is loaded does ...
```diff diff --git a/drivers/platform/x86/asus-laptop.c b/drivers/platform/x86/asus-laptop.c index 40897bab2ebe..6aba24618416 100644 --- a/drivers/platform/x86/asus-laptop.c +++ b/drivers/platform/x86/asus-laptop.c @@ -76,18 +76,18 @@ MODULE_LICENSE("GPL"); * So, if something doesn't work as you want, just try other ...
7677fbdff16f5b817bc3dc5d194a8b3350f8f9cb
Analyze and fix the following issue in the Linux kernel code: acer-wmi: fix memory leaks in wmab_execute error path
Problem Details: When acpi_evaluate_object() is passed ACPI_ALLOCATE_BUFFER, the caller must kfree the returned buffer if AE_OK is returned. Call Trace: wmab_execute -> wmi_evaluate_method -> acpi_evaluate_object Thus if callers of wmab_execute() pass ACPI_ALLOCATE_BUFFER, the return buffer must be kfreed if wm...
```diff diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c index 652ca1800a0a..b06678660956 100644 --- a/drivers/platform/x86/acer-wmi.c +++ b/drivers/platform/x86/acer-wmi.c @@ -555,6 +555,7 @@ static acpi_status AMW0_find_mailled(void) obj->buffer.length == sizeof(struct wmab_ret)) { ...
669048639ca6d3fdfb2e75dd77b8f49434d57625
Analyze and fix the following issue in the Linux kernel code: acer-wmi: fix memory leaks in WMID_set_capabilities and get_wmid_devices
Problem Details: When acpi_evaluate_object() is passed ACPI_ALLOCATE_BUFFER, the caller must kfree the returned buffer if AE_OK is returned. The callers of wmi_query_block() pass ACPI_ALLOCATE_BUFFER, and thus must check its return value before accessing or kfree() on the buffer. This patch adds a missing kfree(out.p...
```diff diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c index dec558ee29e5..652ca1800a0a 100644 --- a/drivers/platform/x86/acer-wmi.c +++ b/drivers/platform/x86/acer-wmi.c @@ -772,6 +772,7 @@ static acpi_status WMID_set_capabilities(void) obj->buffer.length == sizeof(u32)) { devices...
a0dba697eec78fb2d4e2b76b83104a2b251ae70d
Analyze and fix the following issue in the Linux kernel code: acerhdf: fix resource reclaim in error path
Problem Details: Fix resource reclaim in below cases: 1. acerhdf_register_platform() does not properly handle platform_device_alloc() failure and platform_device_add() failure This patch adds error handing for acerhdf_register_platform(). 2. acerhdf_register_platform() return err with acerhdf_dev == NULL. as...
```diff diff --git a/drivers/platform/x86/acerhdf.c b/drivers/platform/x86/acerhdf.c index 4ce28d901b9a..60f9cfcac93f 100644 --- a/drivers/platform/x86/acerhdf.c +++ b/drivers/platform/x86/acerhdf.c @@ -615,17 +615,26 @@ static int acerhdf_register_platform(void) return err; acerhdf_dev = platform_device_alloc("...
6a984a06487129f013ee2df6ce98b6cfada1e7b1
Analyze and fix the following issue in the Linux kernel code: asus-laptop: return proper error for store_ledd if write_acpi_int fail
Problem Details: In current implementation, store_ledd() does not return error if write_acpi_int fail. This patch fixes it by return -ENODEV if write_acpi_int fail. Signed-off-by: Axel Lin <axel.lin@gmail.com> Cc: Matthew Garrett <mjg@redhat.com> Cc: Corentin Chary <corentincj@iksaif.net> Cc: Alan Jenkins <alan-jenki...
```diff diff --git a/drivers/platform/x86/asus-laptop.c b/drivers/platform/x86/asus-laptop.c index 19445eaff6ff..40897bab2ebe 100644 --- a/drivers/platform/x86/asus-laptop.c +++ b/drivers/platform/x86/asus-laptop.c @@ -796,10 +796,11 @@ static ssize_t store_ledd(struct device *dev, struct device_attribute *attr, rv...
9fb866f317def195bb794120e13d1d73c2a94bb2
Analyze and fix the following issue in the Linux kernel code: asus-laptop: fix incorrect return value for write_acpi_int_ret if handle is NULL
Problem Details: According to the comments of write_acpi_int_ret(), write_acpi_int_ret() should return 0 if write is successful, -1 else. Thus if handle is NULL, the write does not happen, it should return -1. Signed-off-by: Axel Lin <axel.lin@gmail.com> Cc: Matthew Garrett <mjg@redhat.com> Cc: Corentin Chary <corent...
```diff diff --git a/drivers/platform/x86/asus-laptop.c b/drivers/platform/x86/asus-laptop.c index 4af5709f8317..19445eaff6ff 100644 --- a/drivers/platform/x86/asus-laptop.c +++ b/drivers/platform/x86/asus-laptop.c @@ -297,7 +297,7 @@ static int write_acpi_int_ret(acpi_handle handle, const char *method, int val, acpi...
3bf460f7b2767df63b76257332c4a9a29d5733c1
Analyze and fix the following issue in the Linux kernel code: asus_acpi: fix coding style to improve readability
Problem Details: In the case of no match ( hotk->model == END_MODEL ), the only posible case to return 0 is to have a Samsung P30 detected. This patch improves readability by moving related code after if/else clause to be inside if clause. Signed-off-by: Axel Lin <axel.lin@gmail.com> Cc: Corentin Chary <corentincj@ik...
```diff diff --git a/drivers/platform/x86/asus_acpi.c b/drivers/platform/x86/asus_acpi.c index ae0914d4e02e..e058c2ba2a15 100644 --- a/drivers/platform/x86/asus_acpi.c +++ b/drivers/platform/x86/asus_acpi.c @@ -1330,6 +1330,9 @@ static int asus_hotk_get_info(void) hotk->model = P30; printk(KERN_NOTICE ...
d47bb5b227f103f9bc0e572f478ac6b2a08fc2b2
Analyze and fix the following issue in the Linux kernel code: asus_acpi: fix a memory leak in asus_hotk_get_info()
Problem Details: In the case of no match ( hotk->model == END_MODEL ), model sholud be kfreed before return AE_OK. This patch includes below fixes: 1. adds a missing kfree(model) before return AE_OK. 2. asus_hotk_get_info should return int, thus return 0 instead of AE_OK. Signed-off-by: Axel Lin <axel.lin@gmail.com...
```diff diff --git a/drivers/platform/x86/asus_acpi.c b/drivers/platform/x86/asus_acpi.c index 92fd30c9379c..ae0914d4e02e 100644 --- a/drivers/platform/x86/asus_acpi.c +++ b/drivers/platform/x86/asus_acpi.c @@ -1340,7 +1340,8 @@ static int asus_hotk_get_info(void) return -ENODEV; } hotk->methods = &model_conf...
08db2b3141b99b476749201eb8e164b39fa7a4ca
Analyze and fix the following issue in the Linux kernel code: sony-laptop: use platform_device_unregister in sony_pf_remove
Problem Details: platform_device_unregister calls platform_device_del and platform_device_put, thus this change is logically equivalent to original code. I made this change because the documents in platform.c shows that: platform_device_del and platform_device_put must _only_ be externally called in error cases. All ...
```diff diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c index a47fd4eef8a3..e3154ff7a39f 100644 --- a/drivers/platform/x86/sony-laptop.c +++ b/drivers/platform/x86/sony-laptop.c @@ -561,8 +561,7 @@ static void sony_pf_remove(void) if (!atomic_dec_and_test(&sony_pf_users)) retur...
32ab72e7ca7aed399b81a3ffec26d7353bd33581
Analyze and fix the following issue in the Linux kernel code: dell-wmi: fix a memory leak
Problem Details: If dell_new_hk_type is true, dell_legacy_wmi_keymap will point to a memory allocated in setup_new_hk_map(). In this case, the memory is not freed in current implementation. This patch fixes the leak by kfree(dell_wmi_keymap) if dell_new_hk_type is true. Signed-off-by: Axel Lin <axel.lin@gmail.com> Sig...
```diff diff --git a/drivers/platform/x86/dell-wmi.c b/drivers/platform/x86/dell-wmi.c index 12a8e6fa1d56..08fb70f6d9bf 100644 --- a/drivers/platform/x86/dell-wmi.c +++ b/drivers/platform/x86/dell-wmi.c @@ -339,13 +339,18 @@ static int __init dell_wmi_init(void) acpi_video = acpi_video_backlight_support(); err = ...
d8eca1105fe2039e102c6a8a915d0af937b1b593
Analyze and fix the following issue in the Linux kernel code: asus-laptop: fix a memory leak in asus_laptop_get_info error path
Problem Details: The callers of write_acpi_int_ret() pass ACPI_ALLOCATE_BUFFER, the caller must kfree the returned buffer if AE_OK is returned. This patch adds a missing kfree(buffer.pointer) before return -ENOMEM if kstrdup fail. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Corentin Chary <corentincj@iksai...
```diff diff --git a/drivers/platform/x86/asus-laptop.c b/drivers/platform/x86/asus-laptop.c index efe8f6388906..4af5709f8317 100644 --- a/drivers/platform/x86/asus-laptop.c +++ b/drivers/platform/x86/asus-laptop.c @@ -1397,8 +1397,10 @@ static int asus_laptop_get_info(struct asus_laptop *asus) } } asus->name = ...
1492616a434dae1908d0da2d6ee6605ca5a77e6f
Analyze and fix the following issue in the Linux kernel code: wmi: fix a memory leak in wmi_notify_debug
Problem Details: When acpi_evaluate_object() is passed ACPI_ALLOCATE_BUFFER, the caller must kfree the returned buffer if AE_OK is returned. The callers of wmi_get_event_data() pass ACPI_ALLOCATE_BUFFER, and thus must check its return value before accessing or kfree() on the buffer. This patch adds return value check...
```diff diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c index 582b5cdd3f43..6c15720be6a4 100644 --- a/drivers/platform/x86/wmi.c +++ b/drivers/platform/x86/wmi.c @@ -518,8 +518,13 @@ static void wmi_notify_debug(u32 value, void *context) { struct acpi_buffer response = { ACPI_ALLOCATE_BUFFER, NU...
d5164dbf1f651d1e955b158fb70a9c844cc91cd1
Analyze and fix the following issue in the Linux kernel code: dell-wmi: Add support for eject key on Dell Studio 1555
Problem Details: Fixes pressing the eject key on Dell Studio 1555 does not work and produces message : dell-wmi: Unknown key 0 pressed Signed-off-by: Islam Amer <pharon@gmail.com>
```diff diff --git a/drivers/platform/x86/dell-wmi.c b/drivers/platform/x86/dell-wmi.c index 66f53c3c35e8..12a8e6fa1d56 100644 --- a/drivers/platform/x86/dell-wmi.c +++ b/drivers/platform/x86/dell-wmi.c @@ -221,7 +221,7 @@ static void dell_wmi_notify(u32 value, void *context) return; } - if (dell_new_hk_type)...
a5167c5b3a842b865b0ca87202b95cc8a84c9e7e
Analyze and fix the following issue in the Linux kernel code: wmi: fix memory leak in parse_wdg
Problem Details: This patch properly kfree out.pointer and gblock in error path. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
```diff diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c index e4eaa14ed987..582b5cdd3f43 100644 --- a/drivers/platform/x86/wmi.c +++ b/drivers/platform/x86/wmi.c @@ -827,8 +827,10 @@ static __init acpi_status parse_wdg(acpi_handle handle) total = obj->buffer.length / sizeof(struct guid_block); ...
1c79632bd011de84f32dcdf7d92b65bb61b1e6da
Analyze and fix the following issue in the Linux kernel code: acer-wmi: fix resource reclaim in acer_wmi_init error path
Problem Details: This patch fixes the resource reclaim in acer_wmi_init error path. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
```diff diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c index 1ea6c434d330..ae79624a692e 100644 --- a/drivers/platform/x86/acer-wmi.c +++ b/drivers/platform/x86/acer-wmi.c @@ -1327,22 +1327,31 @@ static int __init acer_wmi_init(void) "generic video driver\n"); } - if (platfo...
0385e5210c83b13fe685c54b6063655f80bce3ee
Analyze and fix the following issue in the Linux kernel code: IPS driver: add GPU busy and turbo checking
Problem Details: Be sure to enable GPU turbo by default at load time and check GPU busy and MCP exceeded status correctly. Also fix up CPU power comparison and work around buggy MCH temp reporting. Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Matthew Garrett <mjg@redhat.com>
```diff diff --git a/drivers/platform/x86/intel_ips.c b/drivers/platform/x86/intel_ips.c index f1dce3b8372d..cdaf40e44460 100644 --- a/drivers/platform/x86/intel_ips.c +++ b/drivers/platform/x86/intel_ips.c @@ -515,7 +515,10 @@ static void ips_disable_cpu_turbo(struct ips_driver *ips) */ static bool ips_gpu_busy(str...
0fc8f274aef03bbe85774ba30e75deb58e8a90ff
Analyze and fix the following issue in the Linux kernel code: drivers/platform/x86: Eliminate a NULL pointer dereference
Problem Details: Give different error messages if device_enum is NULL or if its type field has the wrong value. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @r exists@ expression E,E1; identifier f; statement S1,S2,S3; @@ if ((E == NULL && ....
```diff diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c index 1387c5f9c24d..a47fd4eef8a3 100644 --- a/drivers/platform/x86/sony-laptop.c +++ b/drivers/platform/x86/sony-laptop.c @@ -1196,9 +1196,13 @@ static void sony_nc_rfkill_setup(struct acpi_device *device) } device_enum =...
6d96e00cef35036c513d342c4676d210b842880d
Analyze and fix the following issue in the Linux kernel code: X86 platform: hp-wmi Better match the HP WMI query interface
Problem Details: - Improve error handling, by explictly return zero for success, error otherwise - WMI query command can have arbitrary input sized params - WMI query command can have specific output sized params (0, 4, 128,..) byte I like to go on here, but this is a rather intrusive change that should be looked at f...
```diff diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c index 7ebe46fe396e..d81f4cf70afc 100644 --- a/drivers/platform/x86/hp-wmi.c +++ b/drivers/platform/x86/hp-wmi.c @@ -80,13 +80,12 @@ struct bios_args { u32 command; u32 commandtype; u32 datasize; - u32 data; + char *data; }; str...
8dda6b0410cfc64642b2ed5b37987292f6321d0f
Analyze and fix the following issue in the Linux kernel code: x86 platform drivers: hp-wmi fix buffer size depending on ACPI version
Problem Details: Depending on ACPI version (1.0 -> 32 bit) an integer could be 32 or 64 bit long. _WED internal concatenates two integers and the return value will be 8 byte (2* 32 bit) or 16 byte (2* 64 bit) long, depending on the ACPI version. Also the data send with the WMI event is defined to be splitted into: -...
```diff diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c index cd445019a6b7..7ebe46fe396e 100644 --- a/drivers/platform/x86/hp-wmi.c +++ b/drivers/platform/x86/hp-wmi.c @@ -352,7 +352,9 @@ static void hp_wmi_notify(u32 value, void *context) struct acpi_buffer response = { ACPI_ALLOCATE_BUFFE...
a2806c6f00d851f11ef8725d78739d48a1ca2fe9
Analyze and fix the following issue in the Linux kernel code: x86 platform drivers: hp-wmi Use consistent prefix string for messages.
Problem Details: Signed-off-by: Thomas Renninger <trenn@suse.de> Signed-off-by: Matthew Garrett <mjg@redhat.com> CC: linux-acpi@vger.kernel.org CC: platform-driver-x86@vger.kernel.org
```diff diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c index 7b086ddf7b2d..e04715abca20 100644 --- a/drivers/platform/x86/hp-wmi.c +++ b/drivers/platform/x86/hp-wmi.c @@ -52,6 +52,8 @@ MODULE_ALIAS("wmi:5FB7F034-2C63-45e9-BE91-3D44E2C707E4"); #define HPWMI_WIRELESS_QUERY 0x5 #define HPWMI_...
4b30fbca4f64bc70c59867ad5769c37efb587ff4
Analyze and fix the following issue in the Linux kernel code: intel_menlow: fix memory leaks in error path
Problem Details: This patch includes below fixes in error path: 1. fix a memory leak if device_create_file failed in intel_menlow_add_one_attribute 2. properly free added attributes before return error in intel_menlow_register_sensor error handler 3. properly call acpi_bus_unregister_driver before return error in intel...
```diff diff --git a/drivers/platform/x86/intel_menlow.c b/drivers/platform/x86/intel_menlow.c index 2f795ce2b939..eacd5da7dd24 100644 --- a/drivers/platform/x86/intel_menlow.c +++ b/drivers/platform/x86/intel_menlow.c @@ -53,6 +53,8 @@ MODULE_LICENSE("GPL"); #define MEMORY_ARG_CUR_BANDWIDTH 1 #define MEMORY_ARG_MAX_...
4696e2958b345189afebcb52e365d16ca6e403ef
Analyze and fix the following issue in the Linux kernel code: trivial: fix a typo in a filename
Problem Details: Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Michal Marek <mmarek@suse.cz>
```diff diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost index 3e3f02409bbd..7d22056582c1 100644 --- a/scripts/Makefile.modpost +++ b/scripts/Makefile.modpost @@ -30,7 +30,7 @@ # - See include/linux/module.h for more details # Step 4 is solely used to allow module versioning in external modules,...
2c2fc151245df37dba17f4ae1760bfa97e4fd3c5
Analyze and fix the following issue in the Linux kernel code: OMAP: DSS2: Taal: Change DSI bus locking to avoid deadlock in ESD work
Problem Details: Move dsi_bus_lock/unlock() out of taal_power_on/off() to avoid deadlock in taal_esd_work(). Signed-off-by: Jani Nikula <ext-jani.1.nikula@nokia.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
```diff diff --git a/drivers/video/omap2/displays/panel-taal.c b/drivers/video/omap2/displays/panel-taal.c index 4e594bb50f4b..137bad23a64e 100644 --- a/drivers/video/omap2/displays/panel-taal.c +++ b/drivers/video/omap2/displays/panel-taal.c @@ -672,8 +672,6 @@ static int taal_power_on(struct omap_dss_device *dssdev) ...
2f1e5f606a1330fa9d1d89e88670c3dec7fbe36f
Analyze and fix the following issue in the Linux kernel code: OMAP: DSS2: Taal: Fix request_irq() error handling
Problem Details: Separate gpio_request() and request_irq() error handling. Signed-off-by: Jani Nikula <ext-jani.1.nikula@nokia.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
```diff diff --git a/drivers/video/omap2/displays/panel-taal.c b/drivers/video/omap2/displays/panel-taal.c index 3421be3d85da..af0750e91a5d 100644 --- a/drivers/video/omap2/displays/panel-taal.c +++ b/drivers/video/omap2/displays/panel-taal.c @@ -603,7 +603,7 @@ static int taal_probe(struct omap_dss_device *dssdev) ...
6b316715b4b96da49fcac0fa07082692eebca8af
Analyze and fix the following issue in the Linux kernel code: OMAP: DSS2: Taal: Add locks to protect taal data access
Problem Details: Avoid potential race conditions in sysfs access to taal data. Signed-off-by: Jani Nikula <ext-jani.1.nikula@nokia.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
```diff diff --git a/drivers/video/omap2/displays/panel-taal.c b/drivers/video/omap2/displays/panel-taal.c index 8fbb94e2bf5d..0eed3282a7a5 100644 --- a/drivers/video/omap2/displays/panel-taal.c +++ b/drivers/video/omap2/displays/panel-taal.c @@ -364,6 +364,8 @@ static ssize_t taal_num_errors_show(struct device *dev, ...
0f16aa0ae6b84d7ae72fbe8999e6a94cb78edd4e
Analyze and fix the following issue in the Linux kernel code: OMAP: DSS2: DSI: use a private workqueue
Problem Details: Using the shared workqueue led to to a deadlock in the case where the display was unblanked via keyboard. What happens is something like this: - User presses a key context 1: - drivers/char/keyboard.c calls schedule_console_callback() - fb_unblank takes the console semaphore - dsi bus lock is taken,...
```diff diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c index 542c6e2a3ff1..de3fdab46f38 100644 --- a/drivers/video/omap2/dss/dsi.c +++ b/drivers/video/omap2/dss/dsi.c @@ -238,6 +238,8 @@ static struct bool te_enabled; + struct workqueue_struct *workqueue; + struct work_struct framedo...
1ceafc00910439c8e5450fae189b69427725992c
Analyze and fix the following issue in the Linux kernel code: OMAP: DSS2: OMAPFB: Add some locking debug checks
Problem Details: Trigger WARN_ON() messages from various places in the code in case the memory region is not currently locked. Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
```diff diff --git a/drivers/video/omap2/omapfb/omapfb-ioctl.c b/drivers/video/omap2/omapfb/omapfb-ioctl.c index 7975a99c33f9..d1f56d37405f 100644 --- a/drivers/video/omap2/omapfb/omapfb-ioctl.c +++ b/drivers/video/omap2/omapfb/omapfb-ioctl.c @@ -222,6 +222,7 @@ static int omapfb_setup_mem(struct fb_info *fbi, struct o...
3d84b65aa63833a2ac07b1cc626984a1e1485fed
Analyze and fix the following issue in the Linux kernel code: OMAP: DSS2: OMAPFB: Make lockdep happy
Problem Details: When more than one memory region needs to be lockd at the same time use the memory region id to fix the order in which the locks are taken. Also one needs to use the _nested() versions of the locking primitives. The memory region id can serve as the lock class there as well. Signed-off-by: Ville Syrjä...
```diff diff --git a/drivers/video/omap2/omapfb/omapfb-ioctl.c b/drivers/video/omap2/omapfb/omapfb-ioctl.c index 3a10146dc120..7975a99c33f9 100644 --- a/drivers/video/omap2/omapfb/omapfb-ioctl.c +++ b/drivers/video/omap2/omapfb/omapfb-ioctl.c @@ -55,7 +55,7 @@ static struct omapfb2_mem_region *get_mem_region(struct oma...
8cab90fdb4c71f9a92c09c015aee42ff2149b317
Analyze and fix the following issue in the Linux kernel code: OMAP: DSS2: Fix update area calculations with multiple scaled overlays
Problem Details: When there are multiple scaled overlays simply checking whether the update area intersects any of them in order is not enough. If eg. VID1 starts out completely outside the update area but VID2 causes the update area to increase in such a way that VID1 now falls partially within the increased update ar...
```diff diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c index 7e1ec5af6c70..a1d84ef65904 100644 --- a/drivers/video/omap2/dss/manager.c +++ b/drivers/video/omap2/dss/manager.c @@ -972,6 +972,7 @@ void dss_setup_partial_planes(struct omap_dss_device *dssdev, int i; u16 x, y, w, h; ...
7cf3d73b4360e91b14326632ab1aeda4cb26308d
Analyze and fix the following issue in the Linux kernel code: kconfig: add savedefconfig
Problem Details: savedefconfig will save a minimal config to a file named "defconfig". The config symbols are saved in the same order as they appear in the menu structure so it should be possible to map them to the relevant menus if desired. The implementation was tested against several minimal configs for arm which ...
```diff diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index 72973591c0f1..c0e459e2b014 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -90,11 +90,14 @@ PHONY += allnoconfig allyesconfig allmodconfig alldefconfig randconfig allnoconfig allyesconfig allmodconfig alldefconfig ra...
1b0e372d7b52c9fc96348779015a6db7df7f286e
Analyze and fix the following issue in the Linux kernel code: ALSA: hda - Fix beep frequency on IDT 92HD73xx and 92HD71Bxx codecs
Problem Details: Fix HDA beep frequency on IDT 92HD73xx and 92HD71Bxx codecs. These codecs use the standard beep frequency calculation although the datasheet says it's linear frequency. Other IDT/STAC codecs might have the same problem. They should be fixed individually later. Signed-off-by: Daniel J Blueman <daniel...
```diff diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index f1e7babd6920..b8d730c47df1 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c @@ -202,6 +202,7 @@ struct sigmatel_spec { unsigned int spdif_mute: 1; unsigned int check_volume_offset:1; unsigned...
4565956dc0847985c0403c9ebbf274b6a122e1e2
Analyze and fix the following issue in the Linux kernel code: l2tp: fix export of header file for userspace
Problem Details: The header file l2tp.h should be exported to the installed include/linux/ tree for userspace programs. This patch fixes compilation errors in L2TP userspace apps which want to use the new L2TP support introduced in 2.6.35. Signed-off-by: James Chapman <jchapman@katalix.com> Signed-off-by: Andrew Mort...
```diff diff --git a/include/linux/Kbuild b/include/linux/Kbuild index 2fc8e14cc24a..9aa9bcadf869 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild @@ -276,6 +276,7 @@ ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm_para.h \ $(srctree)/include/asm-$(SRCARCH)/kvm_para.h),) unifdef-y += kvm_...
cff0d6e6edac7672b3f915bb4fb59f279243b7f9
Analyze and fix the following issue in the Linux kernel code: can-raw: Fix skb_orphan_try handling
Problem Details: Commit fc6055a5ba31e2c14e36e8939f9bf2b6d586a7f5 (net: Introduce skb_orphan_try()) allows an early orphan of the skb and takes care on tx timestamping, which needs the sk-reference in the skb on driver level. So does the can-raw socket, which has not been taken into account here. The patch below adds a...
```diff diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index d89876b806a0..d20d9e7a9bbd 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -169,6 +169,7 @@ struct skb_shared_hwtstamps { * @software: generate software time stamp * @in_progress: device driver is going to provide * ...
68c18697910fdcacea36bd58d2d3d8febfa199a2
Analyze and fix the following issue in the Linux kernel code: ALSA: hda - Fix Thinkpad X300 so SPDIF is not exposed
Problem Details: Just as with the X301. The X300 does not have a way to do SPDIF either. It does not have a dock connector, nor does it have the SPDIF through the headphone jack. This patch fixes it so X300 does not show SPDIF, since it cannot do it. To add all Lenovo Thinkpads had different codec subsytem IDs: X300...
```diff diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c index afbe314a5bf3..b697fd2a6f8b 100644 --- a/sound/pci/hda/patch_analog.c +++ b/sound/pci/hda/patch_analog.c @@ -3662,7 +3662,12 @@ static int patch_ad1984(struct hda_codec *codec) codec->patch_ops.build_pcms = ad1984_build_pcms; br...
607bc3e4888443cdd21a795f7312f64c2de26b5c
Analyze and fix the following issue in the Linux kernel code: ALSA: hda - FIX to not expose SPDIF on Thinkpad X301, since it does not have the ability to use SPDIF
Problem Details: The Lenovo X301 does not have the ability to connect to a docking station to use the SPDIF port. It also does not have the ability to do SPDIF though the headphone jack or Display Port jacks. This patch fixes it so this is not exposed for the X301 and users do think it has the ability to do SPDIF. I ...
```diff diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index d6341f3fef01..df8b19b17308 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c @@ -2057,6 +2057,10 @@ static int patch_cxt5051(struct hda_codec *codec) break; case CXT5051_LENOVO_X200: spec->i...
116bcd9cf22c00c22402c2a2be6ef8e81289a574
Analyze and fix the following issue in the Linux kernel code: ASoC: wm9081: fix resource reclaim in wm9081_register error path
Problem Details: This patch fixes the error path in wm9081_register to properly free resources. Signed-off-by: Axel Lin <axel.lin@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/codecs/wm9081.c b/sound/soc/codecs/wm9081.c index 13186fb4dcb4..76b37ff6c264 100644 --- a/sound/soc/codecs/wm9081.c +++ b/sound/soc/codecs/wm9081.c @@ -1356,7 +1356,7 @@ static int wm9081_register(struct wm9081_priv *wm9081, ret = snd_soc_codec_set_cache_io(codec, 8, 16, control); if ...
d484366beeab0cded9644083172151c5afacc503
Analyze and fix the following issue in the Linux kernel code: ASoC: wm8978: fix a memory leak if a wm8978_register fail
Problem Details: There is a memory leak found if wm8978_register() fail. This patch moves the buffer allocate and release at the same level to prevent the memory leak. Signed-off-by: Axel Lin <axel.lin@gmail.com> Reviewed-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> S...
```diff diff --git a/sound/soc/codecs/wm8978.c b/sound/soc/codecs/wm8978.c index 51d5f433215c..8a1ad778e7e3 100644 --- a/sound/soc/codecs/wm8978.c +++ b/sound/soc/codecs/wm8978.c @@ -1076,7 +1076,6 @@ static __devinit int wm8978_register(struct wm8978_priv *wm8978) err_codec: snd_soc_unregister_codec(codec); err: -...
4eaac50552395f693b8c428872e8b5311c3dab60
Analyze and fix the following issue in the Linux kernel code: ASoC: wm8974: fix a memory leak if another WM8974 is registered
Problem Details: wm8974 is allocated in wm8974_i2c_probe() but is not freed if wm8974_register() return -EINVAL (if another WM8974 is registered). Signed-off-by: Axel Lin <axel.lin@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/codecs/wm8974.c b/sound/soc/codecs/wm8974.c index a2c4b2f37cca..1468fe10cbbe 100644 --- a/sound/soc/codecs/wm8974.c +++ b/sound/soc/codecs/wm8974.c @@ -670,7 +670,8 @@ static __devinit int wm8974_register(struct wm8974_priv *wm8974) if (wm8974_codec) { dev_err(codec->dev, "Another ...
6b5d071e8ba7d802f3123e7b7a37ea13650a98bf
Analyze and fix the following issue in the Linux kernel code: ASoC: wm8961: fix resource reclaim in wm8961_register error path
Problem Details: This patch fixes the error path in wm8961_register to properly free resources. Signed-off-by: Axel Lin <axel.lin@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/codecs/wm8961.c b/sound/soc/codecs/wm8961.c index 5b9a756242f1..2549d3a297ab 100644 --- a/sound/soc/codecs/wm8961.c +++ b/sound/soc/codecs/wm8961.c @@ -1102,7 +1102,7 @@ static int wm8961_register(struct wm8961_priv *wm8961) ret = wm8961_reset(codec); if (ret < 0) { dev_err(codec->...
8089a49d99bb25bc63237ae8e90a84c72897b66d
Analyze and fix the following issue in the Linux kernel code: ASoC: wm8955: fix resource reclaim in wm8955_register error path
Problem Details: This patch fixes the error path in wm8955_register to properly free resources. Signed-off-by: Axel Lin <axel.lin@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/codecs/wm8955.c b/sound/soc/codecs/wm8955.c index fedb76452f1b..5f025593d84d 100644 --- a/sound/soc/codecs/wm8955.c +++ b/sound/soc/codecs/wm8955.c @@ -964,7 +964,8 @@ static int wm8955_register(struct wm8955_priv *wm8955, if (wm8955_codec) { dev_err(codec->dev, "Another WM8955 is ...
db1e18de98c8bdf8a2bfc07623ff67621aa4a332
Analyze and fix the following issue in the Linux kernel code: ASoC: wm8940: fix a memory leak if wm8940_register return error
Problem Details: This patch adds checking for wm8940_register return value, and does kfree(wm8940) if wm8940_register() fail. Signed-off-by: Axel Lin <axel.lin@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/codecs/wm8940.c b/sound/soc/codecs/wm8940.c index e3c4bbfaae27..f0c11138e610 100644 --- a/sound/soc/codecs/wm8940.c +++ b/sound/soc/codecs/wm8940.c @@ -845,6 +845,7 @@ static void wm8940_unregister(struct wm8940_priv *wm8940) static int wm8940_i2c_probe(struct i2c_client *i2c, co...
62f5ad6733b872e14d671b615850eb5bd1cd7e30
Analyze and fix the following issue in the Linux kernel code: ASoC: wm8904: fix resource reclaim in wm8904_register error path
Problem Details: This patch includes below fixes: 1. wm8904 need to be kfreed in wm8904_register() error path before return. 2. fix the error path for snd_soc_register_codec() fail and snd_soc_register_dai() fail to properly free resources. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Liam Girdwood <lrg@s...
```diff diff --git a/sound/soc/codecs/wm8904.c b/sound/soc/codecs/wm8904.c index 87f14f8675fa..f7dcabf6283c 100644 --- a/sound/soc/codecs/wm8904.c +++ b/sound/soc/codecs/wm8904.c @@ -2433,7 +2433,8 @@ static int wm8904_register(struct wm8904_priv *wm8904, if (wm8904_codec) { dev_err(codec->dev, "Another WM8904 i...
2c2749de118bd36645b3a4a56f0d8ef6d4fd09cf
Analyze and fix the following issue in the Linux kernel code: ASoC: wm8711: fix a memory leak if another WM8711 is registered
Problem Details: wm8711 is allocated in either wm8711_spi_probe() or wm8711_i2c_probe() but is not freed if wm8711_register() return -EINVAL(if another ad1836 is registered). Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfson...
```diff diff --git a/sound/soc/codecs/wm8711.c b/sound/soc/codecs/wm8711.c index effb14eee7d4..e2dba07f0260 100644 --- a/sound/soc/codecs/wm8711.c +++ b/sound/soc/codecs/wm8711.c @@ -439,7 +439,8 @@ static int wm8711_register(struct wm8711_priv *wm8711, if (wm8711_codec) { dev_err(codec->dev, "Another WM8711 is ...
ef99e9b5a10086bcc529e6c0a11c6539caee8cd1
Analyze and fix the following issue in the Linux kernel code: ASoC: wm8523: fix resource reclaim in wm8523_register error path
Problem Details: This patch includes below fixes: 1. If another WM8523 is registered, need to kfree wm8523 before return -EINVAL. 2. If snd_soc_register_codec failed, goto error path to properly free resources. 3. Instead of using mixed in-line and goto style cleanup, use goto style error handling if snd_soc_registe...
```diff diff --git a/sound/soc/codecs/wm8523.c b/sound/soc/codecs/wm8523.c index 37242a7d3077..0ad039b4adf5 100644 --- a/sound/soc/codecs/wm8523.c +++ b/sound/soc/codecs/wm8523.c @@ -482,7 +482,8 @@ static int wm8523_register(struct wm8523_priv *wm8523, if (wm8523_codec) { dev_err(codec->dev, "Another WM8523 is ...
085efd28b65582fac459359672421a1c479e7db1
Analyze and fix the following issue in the Linux kernel code: ASoC: da7210: fix a memory leak if failed to initialise da7210 audio codec
Problem Details: da7210 should be kfreed if da7210_init() return error. This patch also fixes the error handing in the case of snd_soc_register_dai() fail by adding snd_soc_unregister_codec() in error path. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark B...
```diff diff --git a/sound/soc/codecs/da7210.c b/sound/soc/codecs/da7210.c index 3e42d1e0e601..3c51d6a57523 100644 --- a/sound/soc/codecs/da7210.c +++ b/sound/soc/codecs/da7210.c @@ -499,7 +499,7 @@ static int da7210_init(struct da7210_priv *da7210) ret = snd_soc_register_dai(&da7210_dai); if (ret) { dev_err(cod...
7bcaad919bc7aaa084f5884aa15654fe1fa4c77f
Analyze and fix the following issue in the Linux kernel code: ASoC: ak4642: fix a memory leak if failed to initialise AK4642
Problem Details: ak4642 should be kfreed if ak4642_init() return error. Signed-off-by: Axel Lin <axel.lin@gmail.com> Reviewed-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
```diff diff --git a/sound/soc/codecs/ak4642.c b/sound/soc/codecs/ak4642.c index 60b83b482467..3d7dc55305ec 100644 --- a/sound/soc/codecs/ak4642.c +++ b/sound/soc/codecs/ak4642.c @@ -498,8 +498,10 @@ static int ak4642_i2c_probe(struct i2c_client *i2c, codec->control_data = i2c; ret = ak4642_init(ak4642); - if (re...
fd3c8ac9cb653f7e3122bba9bc7beaad6062b7f4
Analyze and fix the following issue in the Linux kernel code: ASoC: ad1836: fix a memory leak if another ad1836 is registered
Problem Details: ad1836 is allocated in ad1836_spi_probe() but is not freed if ad1836_register() return -EINVAL (if another ad1836 is registered). Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Barry Song <21cnbao@gmail.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opens...
```diff diff --git a/sound/soc/codecs/ad1836.c b/sound/soc/codecs/ad1836.c index 217538423225..a01006c8c606 100644 --- a/sound/soc/codecs/ad1836.c +++ b/sound/soc/codecs/ad1836.c @@ -272,6 +272,7 @@ static int ad1836_register(struct ad1836_priv *ad1836) if (ad1836_codec) { dev_err(codec->dev, "Another ad1836 is ...
c18de72fb3c72fdc5ca883910761af3f14d90d76
Analyze and fix the following issue in the Linux kernel code: UBIFS: fix a memory leak on error path.
Problem Details: In 'mount_ubifs()', in case of 'ubifs_leb_unmap()' falure, free allocated resources. Signed-off-by: Matthieu CASTET <matthieu.castet@parrot.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
```diff diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c index 010eea009036..5fc5a0988970 100644 --- a/fs/ubifs/super.c +++ b/fs/ubifs/super.c @@ -1320,7 +1320,7 @@ static int mount_ubifs(struct ubifs_info *c) */ err = ubifs_leb_unmap(c, c->gc_lnum); if (err) - return err; + goto out_orphans; } ...
66d50d25502cd9b7d6e3ebbf4e241259c1283eaf
Analyze and fix the following issue in the Linux kernel code: u32: negative offset fix
Problem Details: It was possible to use a negative offset in a u32 match to reference the ethernet header or other parts of the link layer header. This fixes the regression caused by: commit fbc2e7d9cf49e0bf89b9e91fd60a06851a855c5d Author: Changli Gao <xiaosuo@gmail.com> Date: Wed Jun 2 07:32:42 2010 -0700 cls_...
```diff diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c index 4f522143811e..7416a5c73b2a 100644 --- a/net/sched/cls_u32.c +++ b/net/sched/cls_u32.c @@ -134,10 +134,12 @@ next_knode: #endif for (i = n->sel.nkeys; i>0; i--, key++) { - unsigned int toff; + int toff = off + key->off + (off2 & key->offmask)...
eabd8ba9060444cac5b89a3306e607c15ec37418
Analyze and fix the following issue in the Linux kernel code: net: Fix a typo from "dev" to "ndev"
Problem Details: The typo was causing compilation errors since "dev" was not defined. Signed-off-by: Henrique Camargo <henrique.camargo@ensitec.com.br> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c index 2fe709f98cc4..d0824e322068 100644 --- a/drivers/net/davinci_emac.c +++ b/drivers/net/davinci_emac.c @@ -1302,8 +1302,8 @@ static int emac_net_tx_complete(struct emac_priv *priv, struct net_device *ndev = priv->ndev; u32 cnt; - if (...
3bfacf96abc747e3a4bafa7550deb0372d7d0e20
Analyze and fix the following issue in the Linux kernel code: ixgbevf: fix null pointer dereference due to filter being set for VLAN 0
Problem Details: This change corrects an issue that resulted in a null pointer dereference for the addition of VLAN 0 without any VLANs being registered. Also this code removes some unnecessary checks for defines and the unnecessary setting of VLAN flags since that is now handled within the kernel via the vlan_feature...
```diff diff --git a/drivers/net/ixgbevf/ixgbevf_main.c b/drivers/net/ixgbevf/ixgbevf_main.c index 4867440ecfa8..3e291ccc629d 100644 --- a/drivers/net/ixgbevf/ixgbevf_main.c +++ b/drivers/net/ixgbevf/ixgbevf_main.c @@ -1463,18 +1463,10 @@ static void ixgbevf_vlan_rx_add_vid(struct net_device *netdev, u16 vid) { stru...
8e86acd7d5968e08b3e1604e685a8c45f6fd7f40
Analyze and fix the following issue in the Linux kernel code: e1000e: Fix irq_synchronize in MSI-X case
Problem Details: Based on original patch/work from Jean Delvare <jdelvare@suse.de> Synchronize all IRQs when in MSI-X IRQ mode. Jean's original patch hard coded the sync with the 3 possible vectors, this patch incorporates more flexibility for the future and aligns with how igb stores the number of vectors into the ad...
```diff diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h index 9ee133f5034e..f9a31c82f871 100644 --- a/drivers/net/e1000e/e1000.h +++ b/drivers/net/e1000e/e1000.h @@ -348,6 +348,7 @@ struct e1000_adapter { u32 test_icr; u32 msg_enable; + unsigned int num_vectors; struct msix_entry *msix_entr...
c128ec29208d410568469bd8bb373b4cdc10912a
Analyze and fix the following issue in the Linux kernel code: e1000e: register pm_qos request on hardware activation
Problem Details: The pm_qos_add_request call has to register the pm_qos request with the pm_qos susbsystem before first use of the pm_qos request via pm_qos_update_request. As pm_qos changed to use plists there is no benefit in registering and unregistering the pm_qos request on ifup/ifdown and thus we move the regist...
```diff diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c index afd01295fbec..464c9a28f1ba 100644 --- a/drivers/net/e1000e/netdev.c +++ b/drivers/net/e1000e/netdev.c @@ -3218,12 +3218,6 @@ int e1000e_up(struct e1000_adapter *adapter) { struct e1000_hw *hw = &adapter->hw; - /* DMA latency requi...