[PATCH] pstore: fix NULL pointer dereference in console writes

2012-10-30 Thread Colin King
From: Colin Ian King colin.k...@canonical.com Passing a NULL id causes a NULL pointer deference in writers such as erst_writer and efi_pstore_write because they expect to update this id. Pass a dummy id instead. This avoids a cascade of oopses caused when the initial pstore_console_write passes

[PATCH RESEND] pstore: fix NULL pointer dereference in console writes

2012-11-14 Thread Colin King
From: Colin Ian King colin.k...@canonical.com Passing a NULL id causes a NULL pointer deference in writers such as erst_writer and efi_pstore_write because they expect to update this id. Pass a dummy id instead. This avoids a cascade of oopses caused when the initial pstore_console_write passes

[PATCH 2/5] ACPI video: remove unnecessary newline from error messages

2012-11-29 Thread Colin King
From: Colin Ian King colin.k...@canonical.com ACPI_ERROR() already appends a newline, so there is no need for the error messages to include one too. Signed-off-by: Colin Ian King colin.k...@canonical.com --- drivers/acpi/video.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff

[PATCH 3/5] ACPI sysfs: remove unnecessary newline from exception

2012-11-29 Thread Colin King
From: Colin Ian King colin.k...@canonical.com ACPI_EXCEPTION() already appends a newline, so there is no need for the invalid GPE message to include one too. Signed-off-by: Colin Ian King colin.k...@canonical.com --- drivers/acpi/sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[PATCH 5/5] ACPI thermal: remove unnecessary newline from exception message

2012-11-29 Thread Colin King
From: Colin Ian King colin.k...@canonical.com ACPI_EXCEPTION() already appends a newline, so there is no need for the thermal trip point message to include one too. Signed-off-by: Colin Ian King colin.k...@canonical.com --- drivers/acpi/thermal.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH 4/5] ACPICA: GPE support: remove unnecessary newline from error messages

2012-11-29 Thread Colin King
From: Colin Ian King colin.k...@canonical.com ACPI_ERROR() already appends a newline, so there is no need for the error messages to include one too. Signed-off-by: Colin Ian King colin.k...@canonical.com --- drivers/acpi/acpica/hwgpe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH 0/5] remove some unnecessary newline from error messages

2012-11-29 Thread Colin King
From: Colin Ian King colin.k...@canonical.com The ACPI_EXCEPTION and ACPI_ERROR macros already emit a newline after the message, so remove the unnecessary newlines from a bunch of messages. Colin Ian King (5): ACPI dock: remove unnecessary newline from exception message ACPI video: remove

[PATCH 1/5] ACPI dock: remove unnecessary newline from exception message

2012-11-29 Thread Colin King
From: Colin Ian King colin.k...@canonical.com ACPI_EXCEPTION() already appends a newline, so there is no need for the failed _DCK messaged to include one too. Signed-off-by: Colin Ian King colin.k...@canonical.com --- drivers/acpi/dock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[PATCH] perf evsel: fix NULL pointer deference when evsel-counts is NULL

2013-01-19 Thread Colin King
From: Colin Ian King colin.k...@canonical.com __perf_evsel__read_on_cpu() only bails out with -ENOMEM if evsel-counts is NULL and perf_evsel__alloc_counts() has returned an error. If perf_evsel__alloc_counts() does not return an error we get an NULL pointer deference on evsel-counts-cpu[cpu] if

[PATCH RESEND] PCI: Allow pcie_aspm=force to work even when FADT indicates it is unsupported

2012-11-27 Thread Colin King
From: Colin Ian King colin.k...@canonical.com BugLink: http://bugs.launchpad.net/bugs/962038 Right now using pcie_aspm=force will not enable ASPM if the FADT indicates ASPM is unsupported. However, the semantics of force should probably allow for this, especially as they did before the ASPM

[PATCH] ds3000: fix array out of bounds access

2014-03-14 Thread Colin King
From: Colin Ian King colin.k...@canonical.com cppcheck reports an array out of bounds access: [drivers/media/dvb-frontends/ds3000.c:619]: (error) Array 'dvbs2_snr_tab[80]' accessed at index 80, which is out of bounds. the index check is off by one, so fix this to avoid the error.

[PATCH] selftests: ipc: handle msgget failure return correctly

2014-03-05 Thread Colin King
From: Colin Ian King colin.k...@canonical.com A failed msgget causes the test to return an uninitialised value in ret. Assign ret to -errno on error exit. Signed-off-by: Colin Ian King colin.k...@canonical.com --- tools/testing/selftests/ipc/msgque.c | 1 + 1 file changed, 1 insertion(+) diff

[PATCH][v2] selftests: ipc: handle msgget failure return correctly

2014-03-05 Thread Colin King
From: Colin Ian King colin.k...@canonical.com A failed msgget causes the test to return an uninitialised value in ret. Assign ret to -errno on error exit. Signed-off-by: Colin Ian King colin.k...@canonical.com --- tools/testing/selftests/ipc/msgque.c | 1 + 1 file changed, 1 insertion(+) diff

[PATCH] regulator: da9063: fix assignment of da9063_reg_matches to NULL

2014-03-11 Thread Colin King
From: Colin Ian King colin.k...@canonical.com cppcheck detected an incorrect assignment: drivers/regulator/da9063-regulator.c:711]: (warning) Assignment of function parameter has no effect outside the function the original code didn't do anything, instead, *da9063_reg_matches needs to be set

[PATCH] MIPS: Octeon: fix fall through on bar type OCTEON_DMA_BAR_TYPE_SMALL

2014-02-10 Thread Colin King
From: Colin Ian King colin.k...@canonical.com Bar type OCTEON_DMA_BAR_TYPE_SMALL assigns lo and hi addresses and then falls through to OCTEON_DMA_BAR_TYPE_BIG that re-assignes lo and hi addresses with totally different values. Add a break so we don't fall through. Signed-off-by: Colin Ian King

[PATCH] mfd: omap-usb-tll: allocate correct size for ch_clk

2014-02-10 Thread Colin King
From: Colin Ian King colin.k...@canonical.com ch_clk was erroneously being allocated the incorrect size which can be problematic for larger sizes of tll-nch Signed-off-by: Colin Ian King colin.k...@canonical.com --- drivers/mfd/omap-usb-tll.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH][v2] mfd: omap-usb-tll: fix cppcheck sizeof warning

2014-02-11 Thread Colin King
From: Colin Ian King colin.k...@canonical.com Static analysis from cppcheck issued the following warning: [drivers/mfd/omap-usb-tll.c:255]: (warning) Found calculation inside sizeof(). The current size calculation is not obvious and is easy to miscomprehend, so re-work the size of the

[PATCH] IB/mlx4: fix unitialised variable is_mcast

2014-05-17 Thread Colin King
From: Colin Ian King colin.k...@canonical.com Commit 297e0dad7 introduced a bug where is_mcast is now no longer initiialised on the non-multicast condition and so it can be any random value from the stack. This issue was detected by cppcheck: [drivers/infiniband/hw/mlx4/ah.c:103]: (error)

[PATCH] rtlwifi: rtl8188ee: initialize packet_beacon

2014-04-21 Thread Colin King
From: Colin Ian King colin.k...@canonical.com static code analysis from cppcheck reports: [drivers/net/wireless/rtlwifi/rtl8188ee/trx.c:322]: (error) Uninitialized variable: packet_beacon packet_beacon is not initialized and hence packet_beacon contains garbage from the stack, so set it to

[PATCH] clk: st: fix memory leak on gate

2014-04-22 Thread Colin King
From: Colin Ian King colin.k...@canonical.com cppcheck detected a memory leak: [drivers/clk/st/clkgen-pll.c:525]: (error) Memory leak: gate free gate on div allocation failure return path. Signed-off-by: Colin Ian King colin.k...@canonical.com --- drivers/clk/st/clkgen-pll.c | 4 +++- 1 file

[PATCH] clk: versatile: free icst on error return

2014-04-12 Thread Colin King
From: Colin Ian King colin.k...@canonical.com commit a183da63 introduced a new error return path that does not kfree icst if the kmemdup of desc-params fails. Signed-off-by: Colin Ian King colin.k...@canonical.com --- drivers/clk/versatile/clk-icst.c | 1 + 1 file changed, 1 insertion(+) diff

[PATCH] usb: usb3503: return correct error return on failure

2014-06-29 Thread Colin King
From: Colin Ian King colin.k...@canonical.com Fix warning: drivers/usb/misc/usb3503.c:195:11: warning: 'err' may be used uninitialized in this function [-Wmaybe-uninitialized] err is not initialized, the error return should be PTR_ERR(clk) Signed-off-by: Colin Ian King

[PATCH] ACPI / EC: Free saved_ec on error exit path

2014-07-02 Thread Colin King
From: Colin Ian King colin.k...@canonical.com Smatch detected two memory leaks on saved_ec: drivers/acpi/ec.c:1070 acpi_ec_ecdt_probe() warn: possible memory leak of 'saved_ec' drivers/acpi/ec.c:1109 acpi_ec_ecdt_probe() warn: possible memory leak of 'saved_ec' Free saved_ec on these two

[PATCH] arm64/crypto: remove redundant update of data

2014-08-24 Thread Colin King
From: Colin Ian King colin.k...@canonical.com Originally found by cppcheck: [arch/arm64/crypto/sha2-ce-glue.c:153]: (warning) Assignment of function parameter has no effect outside the function. Did you forget dereferencing it? Updating data by blocks * SHA256_BLOCK_SIZE at the end of

[PATCH][V2] UBI: block: fix dereference on uninitialized dev

2014-08-20 Thread Colin King
From: Colin Ian King colin.k...@canonical.com commit 4df38926f337 (UBI: block: Avoid disk size integer overflow) introduced a dereference on dev (which is not initialized at that point) when printing a warning message. Re-order disk_capacity check after the dev is found. Found by cppcheck:

[PATCH] UBI: block: fix dereference on uninitialized dev

2014-08-16 Thread Colin King
From: Colin Ian King colin.k...@canonical.com commit 4df38926f337 (UBI: block: Avoid disk size integer overflow) introduced a dereference on dev (which is not initialized at that point) when printing a warning message. Remove the reference to the dev's disk_name. Found by cppcheck:

[PATCH] drm/vmwgfx: fix asssignment of vmw_bo_p to NULL

2014-08-16 Thread Colin King
From: Colin Ian King colin.k...@canonical.com cppcheck detected an incorrect assignment: [drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c:903]: (warning) Assignment of function parameter has no effect outside the function. Did you forget dereferencing it? the original assigment didn't do anything,

[PATCH] mISDN: remove DSP_NEVER_DEFINED and adjust code identation

2014-09-05 Thread Colin King
From: Colin Ian King colin.k...@canonical.com The DSP_NEVER_DEFINED #ifdef is confusing, it slips in an extra } which is not required because the previous code is indented incorrectly. Correct the identation and remove the extraneous DSP_NEVER_DEFINED Signed-off-by: Colin Ian King

[PATCH] drivers/rtc/interface.c: ignore expired times when enqueing new timers

2014-09-26 Thread Colin King
From: Colin Ian King colin.k...@canonical.com The current enqueuing does not trigger an alarm if there are any expired timers on the timerqueue. This can occur when a RTC wake alarm is used to wake a machine out of hibernate and the resumed state has old expired timers that have not been removed

[PATCH] scsi_debug: test always evaluates to false, || should be used instead

2015-01-22 Thread Colin King
From: Colin Ian King colin.k...@canonical.com cppcheck found the following issue: (warning) Logical conjunction always evaluates to false: alloc_len 4 alloc_len 65535. ..the test should be instead: if (alloc_len 4 || alloc_len 65536) This error was introduced by recent commit

[PATCH][V2] drivers/usb/serial/mos7840.c: remove unused code

2015-01-19 Thread Colin King
From: Colin Ian King colin.k...@canonical.com There is old, unused code that is #defined out by the use of NOTMOS7840 and NOTMCS7840 - these are not defined anywhere. If NOTMOS7840 is defined then the code will break on null pointer dereferences on mos7840_port. So the code is currently unused,

[PATCH] drm/vmwgfx: Correctly NULLify dma buffer pointer on failure

2015-01-22 Thread Colin King
From: Colin Ian King colin.k...@canonical.com cppcheck on lines 917 and 977 show an ineffective assignment to the dma buffer pointer: [drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c:917]: [drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c:977]: (warning) Assignment of function parameter has no effect outside

[PATCH] cxl: remove redundant increment of hwirq

2015-02-01 Thread Colin King
From: Colin Ian King colin.k...@canonical.com Recent commit 80fa93fce37d3490f (cxl: Name interrupts in /proc/interrupt) introduced a redundant increment of hwirq which is not used or even initialised at the point it is incremented. Detected by cppcheck: [drivers/misc/cxl/irq.c:439]: (error)

[PATCH] kconfig: use va_end to match corresponding va_start

2015-01-12 Thread Colin King
From: Colin Ian King colin.k...@canonical.com Although on some systems va_end is a no-op, it is good practice to use va_end, especially since the manual states: Each invocation of va_start() must be matched by a corresponding invocation of va_end() in the same function. Signed-off-by: Colin Ian

[PATCH] drivers/usb/serial/mos7840.c: remove unused code

2015-01-13 Thread Colin King
From: Colin Ian King colin.k...@canonical.com There is old, unused code that is #defined out by the use of NOTMOS7840 - this is not defined anywhere. If NOTMOS7840 is defined then the code will break on null pointer dereferences on mos7840_port. So the code is currently unused, and broken

[PATCH] rtlwifi/rtl8192de: remove redundant else if check

2015-01-13 Thread Colin King
From: Colin Ian King colin.k...@canonical.com The else if check condition checks for the opposite of the if check, hence the else if check is redundant and can be replaced with a simple else: if (rtlpriv-rtlhal.macphymode == SINGLEMAC_SINGLEPHY) { .. } else if (rtlpriv-rtlhal.macphymode

[PATCH] cxl: remove redundant increment of hwirq

2015-01-08 Thread Colin King
From: Colin Ian King colin.k...@canonical.com hwirq has not been initialized, however it is being incremented and also not being referenced in a loop. This error was detected with cppcheck: [drivers/misc/cxl/irq.c:439]: (error) Uninitialized variable: hwirq Commit 80fa93fce37d (cxl: Name

[PATCH] ALSA: snd-usb-usx2y: fix incorrect indentation on if statement

2015-01-14 Thread Colin King
From: Colin Ian King colin.k...@canonical.com Minor style issue, statement needs an extra tab indentation on the if statement. Signed-off-by: Colin Ian King colin.k...@canonical.com --- sound/usb/usx2y/usbusx2yaudio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH] x86/time/rtc: remove duplicate const specifier

2015-01-14 Thread Colin King
From: Colin Ian King colin.k...@canonical.com Building with clang: CC arch/x86/kernel/rtc.o arch/x86/kernel/rtc.c:173:29: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier] static const char * const const ids[] __initconst = Remove the duplicate

[PATCH][RESEND] static code analysis from cppcheck reports:

2015-01-12 Thread Colin King
From: Colin Ian King colin.k...@canonical.com [drivers/video/fbdev/broadsheetfb.c:673]: (error) Memory leak: sector_buffer sector_buffer is not being kfree'd on each call to broadsheet_spiflash_rewrite_sector(), so free it. Signed-off-by: Colin Ian King colin.k...@canonical.com ---

[PATCH] rtlwifi: ratelimit skb allocation failure message

2015-02-10 Thread Colin King
From: Colin Ian King colin.k...@canonical.com when running low on memory I noticed rtlwifi was producing a large quantity of repeated skb allocation failures messages. This should be ratelimited to reduce the noise. Signed-off-by: Colin Ian King colin.k...@canonical.com ---

[PATCH] PM / clock_ops: initialize ret to avoid garbage being returned

2015-01-08 Thread Colin King
From: Colin Ian King colin.k...@canonical.com cppcheck detected an unitialised ret: [drivers/base/power/clock_ops.c:53]: (error) Uninitialized variable: ret ret is only assigned if ce-status PCE_STATUS_ERROR, if this is false then __pm_clk_enable returns whatever garbage ret picks up from the

[PATCH] can: gs_usb: check for kzalloc allocation failure

2015-03-16 Thread Colin King
From: Colin Ian King colin.k...@canonical.com smatch detected the following issue: drivers/net/can/usb/gs_usb.c:904 gs_usb_probe() error: potential null dereference 'dev'. (kzalloc returns null) Add a check for null return from kzalloc and return -ENOMEM Signed-off-by: Colin Ian King

[PATCH][v2] pinctrl: sirf: fix typo in kernel warning on a bad interrupt

2015-02-28 Thread Colin King
From: Colin Ian King colin.k...@canonical.com Fix typo, flaged - flagged Signed-off-by: Colin Ian King colin.k...@canonical.com --- drivers/pinctrl/sirf/pinctrl-sirf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pinctrl/sirf/pinctrl-sirf.c

[PATCH][v2] dmaengine: s3c24xx: Fix spelling mistake in dev_err mistake

2015-02-28 Thread Colin King
From: Colin Ian King colin.k...@canonical.com Fix spelling mistake, aquire - acquire and missing newline (as spotted by Joe Perches. Signed-off-by: Colin Ian King colin.k...@canonical.com --- drivers/dma/s3c24xx-dma.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

[PATCH] crypto: fix typo in dev_err error message

2015-02-28 Thread Colin King
From: Colin Ian King colin.k...@canonical.com Fix typo, intialization - initialization Signed-off-by: Colin Ian King colin.k...@canonical.com --- drivers/crypto/atmel-aes.c | 2 +- drivers/crypto/atmel-sha.c | 2 +- drivers/crypto/atmel-tdes.c | 2 +- 3 files changed, 3 insertions(+), 3

[PATCH] dmaengine: s3c24xx: Fix spelling mistake in dev_err mistake

2015-02-28 Thread Colin King
From: Colin Ian King colin.k...@canonical.com Fix spelling mistake, aquire - acquire Signed-off-by: Colin Ian King colin.k...@canonical.com --- drivers/dma/s3c24xx-dma.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/dma/s3c24xx-dma.c b/drivers/dma/s3c24xx-dma.c

[PATCH] scsi: ufs: fix typo in dev_err error message

2015-02-28 Thread Colin King
From: Colin Ian King colin.k...@canonical.com Fix typo, Intialization - Initialization Signed-off-by: Colin Ian King colin.k...@canonical.com --- drivers/scsi/ufs/ufshcd-pltfrm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/ufs/ufshcd-pltfrm.c

[PATCH] pinctrl: sirf: fix typo in kernel warning on a bad interruot

2015-02-28 Thread Colin King
From: Colin Ian King colin.k...@canonical.com Fix typo, flaged - flagged Signed-off-by: Colin Ian King colin.k...@canonical.com --- drivers/pinctrl/sirf/pinctrl-sirf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pinctrl/sirf/pinctrl-sirf.c

[PATCH] mtd: atmel_nand: fix typo in dev_err error message

2015-02-28 Thread Colin King
From: Colin Ian King colin.k...@canonical.com Fix typo, Unkown - Unknown Signed-off-by: Colin Ian King colin.k...@canonical.com --- drivers/mtd/nand/atmel_nand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c

[PATCH] wil6210: increase cmd buffer size to avoid sscanf buffer overflow

2015-03-01 Thread Colin King
From: Colin Ian King colin.k...@canonical.com cppcheck detected a buffer overflow: [drivers/net/wireless/ath/wil6210/debugfs.c:634]: (error) Width 8 given in format string (no. 1) is larger than destination buffer 'cmd[8]', use %7s to prevent overflowing it. For the current %8s sscanf we

[PATCH] arch: tile: fix null pointer dereference on pt_regs pointer

2015-03-01 Thread Colin King
From: Colin Ian King colin.k...@canonical.com Cppcheck reports the following issue: [arch/tile/kernel/stack.c:116]: (error) Possible null pointer dereference: p In this case, on reporting on an odd fault, p is set to NULL and immediately afterwords p is dereferenced iff !kbt-profile is false.

[PATCH] eCryptfs: ensure copy to crypt_stat-cipher does not overrun

2015-02-23 Thread Colin King
From: Colin Ian King colin.k...@canonical.com The patch 237fead61998: [PATCH] ecryptfs: fs/Makefile and fs/Kconfig from Oct 4, 2006, leads to the following static checker warning: fs/ecryptfs/crypto.c:846 ecryptfs_new_file_context() error: off-by-one overflow 'crypt_stat-cipher' size 32. rl

[PATCH] pinctrl: mediatek: mtk-common: initialize unmask

2015-04-20 Thread Colin King
From: Colin Ian King colin.k...@canonical.com cppcheck detected an unitialized variable: [drivers/pinctrl/mediatek/pinctrl-mtk-common.c:897]: (error) Uninitialized variable: unmask unmask should be initialized to zero to ensure unmasking only occurs if a previous mask occurred. The current

[PATCH][V2] pinctrl: mediatek: mtk-common: initialize unmask

2015-04-20 Thread Colin King
From: Colin Ian King colin.k...@canonical.com cppcheck detected an uninitialized variable: [drivers/pinctrl/mediatek/pinctrl-mtk-common.c:897]: (error) Uninitialized variable: unmask unmask should be initialized to zero to ensure unmasking only occurs if a previous mask occurred. The current

[PATCH] ti-st: handle null allocation return correctly.

2015-05-12 Thread Colin King
From: Colin Ian King colin.k...@canonical.com static analysis with smatch picked up the following error: get_platform_data() error: potential null dereference 'dt_pdata'. (kzalloc returns null) ironically, the code already checks for a null kzalloc return and emits an error message. Fix by

[PATCH][V2] ti-st: handle null allocation return correctly.

2015-05-12 Thread Colin King
From: Colin Ian King colin.k...@canonical.com static analysis with smatch picked up the following error: get_platform_data() error: potential null dereference 'dt_pdata'. (kzalloc returns null) Instead, the code should return NULL to avoid the following null pointer deference. Also, remove

[PATCH] ARM: 8351/1: perf: fix memory leak on return

2015-05-15 Thread Colin King
From: Colin Ian King colin.k...@canonical.com Recent commit 3b8786ff7a1b31645ae2c26a2ec32dbd42ac1094 (ARM: 8352/1: perf: Fix the pmu node name in warning message) introduced a memory leak of irqs on the Don't bother with PPIs return path. This was picked up by static analysis by cppcheck:

[PATCH][V3] ARM: pmu: fix memory leak due to early return not freeing irqs

2015-05-18 Thread Colin King
From: Colin Ian King colin.k...@canonical.com Recent commit 338d9dd3e2ae (ARM: 8351/1: perf: don't warn about missing interrupt-affinity property for PPIs) introduced a memory leak of irqs on the Don't bother with PPIs return path. This issue was picked up by static analysis by cppcheck:

[PATCH] sgi-gru: fix null pointer dereference on failed kzalloc

2015-05-13 Thread Colin King
From: Colin Ian King colin.k...@canonical.com static analysis from smatch found a potential null dereference: drivers/misc/sgi-gru/grutlbpurge.c:320 gru_register_mmu_notifier() error: potential null dereference 'gms'. (kzalloc returns null) bail out with -ENOMEM rather than falling through

[PATCH][V2] ARM: 8351/1: perf: fix memory leak on return

2015-05-18 Thread Colin King
From: Colin Ian King colin.k...@canonical.com Recent commit 3b8786ff7a1b31645ae2c26a2ec32dbd42ac1094 (ARM: 8352/1: perf: Fix the pmu node name in warning message) introduced a memory leak of irqs on the Don't bother with PPIs return path. This was picked up by static analysis by cppcheck:

[PATCH] crypto: ensure backlog is initialised

2015-04-14 Thread Colin King
From: Colin Ian King colin.k...@canonical.com backlog is not initialised so in the case where cpg-eng_st != ENGINE_IDLE it is never initialised and hence which could lead to an illegal memory dereference in the statement: backlog-complete(backlog, -EINPROGRESS); Discovered with cppcheck

[PATCH] regulator: max8660: fix assignment of pdata to data that becomes dead

2015-04-07 Thread Colin King
From: Colin Ian King colin.k...@canonical.com pdata is assigned to pdata_of, however, pdata_of becomes dead (when it goes out of scope) so pdata effectively becomes a dead pointer to the out of scope object. This is detected by static analysis: [drivers/regulator/max8660.c:411]: (error) Dead

[PATCH] fddi: print an address with %p format specifier rather than %x

2015-06-05 Thread Colin King
From: Colin Ian King colin.k...@canonical.com The debug is printing the struct smt_header * address using the %x format specifier. Fix it to use %p instead. Signed-off-by: Colin Ian King colin.k...@canonical.com --- drivers/net/fddi/skfp/srf.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH][V3] usb: isp1760: check for null return from kzalloc

2015-06-02 Thread Colin King
From: Colin Ian King colin.k...@canonical.com isp1760_ep_alloc_request allocates a structure with kzalloc without checking for NULL and then returns a pointer to one of the structure fields. As the field happens to be the first in the structure the caller can properly check for NULL, but this

[PATCH] megaraid_sas: insert missing space in kernel message

2015-06-09 Thread Colin King
From: Colin Ian King colin.k...@canonical.com The printk format specifier string is missing a space between the %p format specifier and the on the defer text. Minor fix, add the missing space. Signed-off-by: Colin Ian King colin.k...@canonical.com --- drivers/scsi/megaraid/megaraid_sas_base.c |

[PATCH] jfs: fix indentation on if statement

2015-06-04 Thread Colin King
From: Colin Ian King colin.k...@canonical.com The if statement and closing brace are indented by 1 extra space, so remove this extra spacing. Cosmetic change only. Signed-off-by: Colin Ian King colin.k...@canonical.com --- fs/jfs/inode.c | 4 ++-- 1 file changed, 2 insertions(+), 2

[PATCH] RDMA/ocrdma: fix double free on pd

2015-06-05 Thread Colin King
From: Colin Ian King colin.k...@canonical.com A reorganisation of the PD allocation and deallocation in commit 9ba1377daa (RDMA/ocrdma: Move PD resource management to driver.) introduced a double free on pd, as detected by static analysis by smatch:

[PATCH] altera-stapl: remove extraneous KERN_INFO prefix

2015-06-16 Thread Colin King
From: Colin Ian King colin.k...@canonical.com The KERN_INFO prefix is being prepended to KERN_DEBUG when using the dprink macro, Remove it as it is extraneous since we are printing the message out as debug via dprintk(). Fixes smatch warning: drivers/misc/altera-stapl/altera.c:2454

[PATCH] usb: isp1760: fix null dereference if kzalloc returns null

2015-05-31 Thread Colin King
From: Colin Ian King colin.k...@canonical.com If kzalloc returns null then isp1760_ep_alloc_request performs a null pointer deference on req. Check for null to avoid this. Detected with smatch static analysis: drivers/usb/isp1760/isp1760-udc.c:816 isp1760_ep_alloc_request() error: potential

[PATCH][V2] usb: isp1760: fix null dereference if kzalloc returns null

2015-05-31 Thread Colin King
From: Colin Ian King colin.k...@canonical.com If kzalloc returns null then isp1760_ep_alloc_request performs a null pointer dereference on req. Check for null to avoid this. Detected with smatch static analysis: drivers/usb/isp1760/isp1760-udc.c:816 isp1760_ep_alloc_request() error: potential

[PATCH] drm/nouveau: usif_ioctl: ensure returns are initialized

2015-07-01 Thread Colin King
From: Colin Ian King colin.k...@canonical.com Various usif_ioctl helper functions do not initialize the return variable ret and some of the error handling return paths just return garbage values that were on the stack (or in a register). I believe that in all the cases, the initial ret variable

[PATCH] ALSA: Fix uninintialized error return

2015-06-29 Thread Colin King
From: Colin Ian King colin.k...@canonical.com Static analysis with cppcheck found the following error: [sound/core/init.c:118]: (error) Uninitialized variable: err ..this was introduced by commit 2471b6c80a70e80de69f5ff4c37187c3912e5874 (ALSA: info: Register proc entries recursively, too)

[PATCH] [SCSI] bfa: fix missing { } braces

2015-08-03 Thread Colin King
From: Colin Ian King colin.k...@canonical.com Static analysis by smatch indicated that there was a curly braces issue: drivers/scsi/bfa/bfa_ioc.c:3668 bfa_cb_sfp_state_query() warn: curly braces intended? drivers/scsi/bfa/bfa_ioc.c:3671 bfa_cb_sfp_state_query() warn: inconsistent

[PATCH] tools/power: turbostat: fix build warnings

2015-08-20 Thread Colin King
From: Colin Ian King colin.k...@canonical.com We're getting build warnings because of poorly defined function declarations: turbostat.c: In function ‘dump_cstate_pstate_config_info’: turbostat.c:1877:1: warning: type of ‘family’ defaults to ‘int’ [-Wimplicit-int]

[PATCH] ACPI / resources: fix memory leak on request_range fail path

2015-06-29 Thread Colin King
From: Colin Ian King colin.k...@canonical.com static analysis from cppcheck detected a memory leak: [drivers/acpi/resource.c:664]: (error) Memory leak: reg the error path on a failed request_range call should free reg before returning. Bug introduced in the recent commit

[PATCH] PM / clk: don't return int on __pm_clk_enable

2015-06-29 Thread Colin King
From: Colin Ian King colin.k...@canonical.com Static analysis by cppcheck found an issue that was recently introduced by commit 471f7707b6f0b1 (PM / clock_ops: make __pm_clk_enable more generic) where a return status in ret was not being initialised and garbage being returned when ce-status =

[PATCH] scsi: a100u2w: trivial typo in printk

2015-07-29 Thread Colin King
From: Colin Ian King colin.k...@canonical.com Trivial typo fix, \b should be \n Signed-off-by: Colin Ian King colin.k...@canonical.com --- drivers/scsi/a100u2w.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/a100u2w.c b/drivers/scsi/a100u2w.c index

[PATCH] spi: spidev: fix inconsistent indenting

2015-07-31 Thread Colin King
From: Colin Ian King colin.k...@canonical.com Fix inconsistent indenting in spidev_open, no functional change. Signed-off-by: Colin Ian King colin.k...@canonical.com --- drivers/spi/spidev.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spidev.c

[PATCH] crypto: fix spelling mistake in dev_err error message

2015-08-02 Thread Colin King
From: Colin Ian King colin.k...@canonical.com Trival change, fix spelling mistake 'aquire' - 'acquire' in dev_err message. Signed-off-by: Colin Ian King colin.k...@canonical.com --- drivers/crypto/img-hash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH] pinctrl/mediatek: fix spelling mistake in dev_err error message

2015-08-02 Thread Colin King
From: Colin Ian King colin.k...@canonical.com Trivial change, fix spelling mistake 'invaild' - 'invalid' in dev_err message. Signed-off-by: Colin Ian King colin.k...@canonical.com --- drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH] lpfc: fix double free on mp

2015-07-31 Thread Colin King
From: Colin Ian King colin.k...@canonical.com The error path when the call to lpfc_sli_issue_mbox returns MBX_NOT_FINISHED results in the code freeing mp and calling lpfc_mbuf_free twice. Fix this by jumping to the correct part of the error clean up path. Signed-off-by: Colin Ian King

[PATCH] megaraid_sas: fix missing { } braces

2015-08-03 Thread Colin King
From: Colin Ian King colin.k...@canonical.com Static analysis by smatch indicated that there was a curly braces issue: drivers/scsi/megaraid/megaraid_sas_base.c:6139 megasas_mgmt_fw_ioctl() warn: curly braces intended? Add braces in the appropriate place so that kbuf_arr[i] gets set to NULL

[PATCH] dm cache: fix alloc_bitset check that always evaluates as false

2015-07-23 Thread Colin King
From: Colin Ian King colin.k...@canonical.com static analysis by cppcheck has found a check on alloc_bitset that always evaluates as false and hence never finds an allocation failure: [drivers/md/dm-cache-policy-smq.c:1689]: (warning) Logical conjunction always evaluates to false: !EXPR EXPR.

[PATCH] i2c: viperboard: clean up inconsistent indenting

2015-07-17 Thread Colin King
From: Colin Ian King colin.k...@canonical.com Minor clean up of indenting, no functional change Signed-off-by: Colin Ian King colin.k...@canonical.com --- drivers/i2c/busses/i2c-viperboard.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git

[PATCH] xen: fix non-ANSI function declaration of function xen_has_pv_devices

2015-07-16 Thread Colin King
From: Colin Ian King colin.k...@canonical.com xen_has_pv_devices has no parameters, so use the normal void parameter convention to make it match the prototype in the header file include/xen/platform_pci.h Signed-off-by: Colin Ian King colin.k...@canonical.com ---

[PATCH] xen: fix non-ANSI function declaration of function xen_has_pv_devices

2015-07-16 Thread Colin King
From: Colin Ian King colin.k...@canonical.com xen_has_pv_devices has no parameters, so use the normal void parameter convention to make it match the prototype in the header file include/xen/platform_pci.h Signed-off-by: Colin Ian King colin.k...@canonical.com ---

[PATCH] mtd: fix null pointer deference when kzalloc returns null

2015-07-17 Thread Colin King
From: Colin Ian King colin.k...@canonical.com static analysis by smatch caught the following error: drivers/mtd/maps/physmap_of.c:135 of_get_probes() error: potential null dereference 'res'. (kzalloc returns null) Check for failed kzalloc and return -ENOMEM in of_flash_probe if this occurs.

[PATCH] pcmcia: remove KERN_INFO level from debug message

2015-07-17 Thread Colin King
From: Colin Ian King colin.k...@canonical.com The KERN_INFO level is being appended to the %s: string in the DEBUGP macro, so it isn't actually doing what was originally intended and instead inserts it in the wrong place. Remove it so it is at least we're using the DEBUGP macro consistently

[PATCH] fjes: fix inconsistent indenting

2015-11-11 Thread Colin King
From: Colin Ian King minor change, indenting is one tab out. Signed-off-by: Colin Ian King --- drivers/net/fjes/fjes_hw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/fjes/fjes_hw.c

[PATCH] [media] hackrf: don't emit dev debug on a kfree'd or null dev

2015-11-11 Thread Colin King
From: Colin Ian King Static analysis with smatch detected a couple of issues: drivers/media/usb/hackrf/hackrf.c:1533 hackrf_probe() error: we previously assumed 'dev' could be null (see line 1366) drivers/media/usb/hackrf/hackrf.c:1533 hackrf_probe() error:

[PATCH] dmaengine: zxdma: fix memset that is currently doing nothing

2015-10-08 Thread Colin King
From: Colin Ian King The size and value arguments are swapped in the call to memset effectively making it a no-op because of the zero size. Swap these arguments around to do the memset correctly. Signed-off-by: Colin Ian King ---

[PATCH] powerpc/pseries/hvcserver: don't memset pi_buff if it is null

2015-10-08 Thread Colin King
From: Colin Ian King pi_buff is being memset before it is sanity checked. Move the memset after the null pi_buff sanity check to avoid an oops. Signed-off-by: Colin Ian King --- arch/powerpc/platforms/pseries/hvcserver.c | 2 +- 1 file

[PATCH] staging: wilc1000: fix memory leak on mgmt_tx on error return path

2015-10-09 Thread Colin King
From: Colin Ian King Static analysis with cppcheck found the following memory leak: [drivers/staging/wilc1000/linux_mon.c:255]: (error) Memory leak: mgmt_tx Free mgmt_tx on the error return path when mgmt_tx->buff fails to be allocated. Signed-off-by: Colin Ian King

[PATCH] ps3-vuart: BUG_ON on null drv before dereferencing it on dev_dbg

2015-09-01 Thread Colin King
From: Colin Ian King On the unlikely event that drv is null, the current code will perform a null pointer dereference with it when printing a dev_dbg message. Instead, the BUG_ON check on drv should be performed before we emit the dev_dbg message. Signed-off-by: Colin

[PATCH] ath6kl: remove redundant null pointer check on send_pkt

2015-09-07 Thread Colin King
From: Colin Ian King The check for send_pkt being NULL is redundant before the call to htc_reclaim_txctrl_buf, therefore it should be removed. This was detected by static analysis by cppcheck. Signed-off-by: Colin Ian King ---

[PATCH] char: remove unused variable res to clean up build warning

2015-09-07 Thread Colin King
From: Colin Ian King Commit f368ed6088ae9 ("char: make misc_deregister a void function") did not remove unused variable res and now we get a build warning: drivers/rtc/rtc-ds1374.c: In function 'ds1374_remove': drivers/rtc/rtc-ds1374.c:667:6: warning: unused variable

[PATCH] xfs: fix null pointer dereference when mapping is NULL

2015-09-03 Thread Colin King
From: Colin Ian King xfs_vm_set_page_dirty checks to see if mapping is NULL however before this unlikely check it already dereferenced mapping when initializing inode. Move the inode initialization after the mapping null check to avoid a potential null pointer

[PATCH] [media] c8sectpfe: fix ininitialized error return on firmware load failure

2015-09-15 Thread Colin King
From: Colin Ian King static analysis with cppcheck detected the following error: [drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c:1210]: (error) Uninitialized variable: ret ret is never initialised, so garbage is being returned. Instead return the error return

[PATCH] FMC: remove unused integer len and dead assignment

2015-09-29 Thread Colin King
From: Colin Ian King static analysis using clang's scan-build detected a dead assignment to len which can be removed. Signed-off-by: Colin Ian King --- drivers/fmc/fru-parse.c | 2 -- 1 file changed, 2 deletions(-) diff --git

  1   2   3   4   5   6   7   8   9   10   >