'phy' has been allocated with 'devm_kzalloc', so we should not free it
using an explicit 'kfree'. It would result in a double free if the
allocation of 'in_buf' fails.
Signed-off-by: Christophe JAILLET
---
drivers/nfc/pn533/usb.c | 9 +++--
1 fi
If 'ioremap()' returns 0, 'gm20b_tegra_read_wpr()' will return 0 as well,
which means success.
Return -ENOMEM instead
Signed-off-by: Christophe JAILLET
---
Not sure that -ENOMEM is the best value.
I've taken it because it is often used in such a case.
---
drivers/gp
If 'dma_alloc_coherent()' returns NULL, 'vpu_alloc_ext_mem()' will
return 0 which means success.
Return -ENOMEM instead.
Signed-off-by: Christophe JAILLET
---
drivers/media/platform/mtk-vpu/mtk_vpu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/driver
r_brick_register()'.
Signed-off-by: Christophe JAILLET
---
drivers/gpu/drm/tegra/sor.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/gpu/drm/tegra/sor.c b/drivers/gpu/drm/tegra/sor.c
index 74d0540b8d4c..a8f528925009 100644
--- a/drivers/gpu/drm/tegra/sor.c
+++ b/drivers/gpu/dr
returned by clk_register().
Fix commit f5644f10dcfb ("clk: at91: Migrate to clk_hw based registration
and OF APIs")
Signed-off-by: Christophe JAILLET
---
It is likely that a bigger change is needed. For example using clk_register
instead of clk_hw_register would return the err
If 'clk_hw_register()' fails, it is likely that we expect to return an
error instead of a valid pointer (which would mean success).
Fix commit f5644f10dcfb ("clk: at91: Migrate to clk_hw based registration
and OF APIs")
Signed-off-by: Christophe JAILLET
---
v2: clk_hw_reg
If the test 'if (channel > 5)' is true, then we will return 'err' which
is known to be 0 at this point.
Return -EINVAL instead.
Signed-off-by: Christophe JAILLET
---
Un-tested
---
drivers/spmi/spmi-pmic-arb.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers
Le 15/09/2016 à 19:34, Marcelo a écrit :
On Sun, Sep 04, 2016 at 11:38:13AM +0200, Christophe JAILLET wrote:
In commit 311b21774f13 ("sctp: simplify sk_receive_queue locking"), a call
to 'skb_queue_splice_tail_init()' has been made explicit. Previously it was
hidden in
This patch:
- improves code layout
- removes a useless memset(0) for some memory allocated with kzalloc
- removes a useless if. We know that 'if (chan_band_tlv)' will succeed
because it has been tested a few lines above
Signed-off-by: Christophe JAILLET
---
drivers/ne
It is likely that checking the result of the memory allocation just above
is expected here.
Signed-off-by: Christophe JAILLET
---
drivers/staging/media/s5p-cec/s5p_cec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/media/s5p-cec/s5p_cec.c
b/drivers
When calling 'snd_pcm_format_physical_width', SNDRV_PCM_FORMAT_LAST is a
valid value, so don't skip it.
Signed-off-by: Christophe JAILLET
---
Un-tested
---
sound/soc/omap/omap-pcm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/omap/omap-pcm.c b
When calling 'snd_pcm_format_width', SNDRV_PCM_FORMAT_LAST is a
valid value, so don't skip it.
Signed-off-by: Christophe JAILLET
---
Un-tested
---
sound/soc/davinci/davinci-mcasp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/davinci/davinci-mcasp
f its
type.
Signed-off-by: Christophe JAILLET
---
drivers/net/wireless/marvell/mwifiex/sta_ioctl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c
b/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c
index e06647a..78819e8 10064
This patch should be a no-op. It just simplifies code by using the name of
a variable instead of its type when calling 'sizeof'.
Signed-off-by: Christophe JAILLET
---
drivers/net/wireless/marvell/mwifiex/sta_ioctl.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git
Le 23/08/2016 à 11:23, Arnd Bergmann a écrit :
On Tuesday, August 23, 2016 6:20:28 AM CEST Christophe JAILLET wrote:
Le 22/08/2016 à 10:42, Arnd Bergmann a écrit :
[...]
Sorry, but I'm not following the logic here.
[...]
You argue that the two have the same meaning, which I see, but
why
this bitmap
- modify code now that 'vt8500_ports_in_use' has become a pointer
because of the use of DECLARE_BITMAP
It has been spotted by the following coccinelle script:
@@
expression ret, x;
@@
* ret = \(find_first_bit \| find_first_zero_bit\) (x, sizeof(...));
Signed-off-by: Christophe
64 instead.
It has been spotted by the following coccinelle script:
@@
expression ret, x;
@@
* ret = \(find_first_bit \| find_first_zero_bit\) (x, sizeof(...));
Signed-off-by: Christophe JAILLET
---
Not sure that using 64 directly is the best option.
Maybe '8 * sizeof(port_mask)' as
In all other places in this file where 'find_first_bit' is called,
port_num is defined as a 'u8' and no casting is done.
Do the same here in order to be more consistent.
Signed-off-by: Christophe JAILLET
---
drivers/infiniband/hw/hfi1/mad.c | 4 ++--
1 file changed
So use
BITS_PER_LONG instead.
It has been spotted by the following coccinelle script:
@@
expression ret, x;
@@
* ret = \(find_first_bit \| find_first_zero_bit\) (x, sizeof(...));
Signed-off-by: Christophe JAILLET
---
__ffs could be used to reduce code verbosity
---
drivers/infiniband/hw/mlx5/me
'ret' is known to be 0 at this point.
If 'ioremap()' fails, returns -ENOMEM instead of 0 which means success.
Signed-off-by: Christophe JAILLET
---
drivers/edac/thunderx_edac.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/edac/thunderx_edac.c b/drivers/edac/t
'res' is known to be 0 at this point.
If 'devm_ioremap()' fails, returns -ENOMEM instead of 0 which means
success.
Signed-off-by: Christophe JAILLET
---
drivers/edac/altera_edac.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/edac/altera_e
'err' is known to be 0 at this point.
If 'kzalloc()' fails, returns -ENOMEM instead of 0 which means success.
Signed-off-by: Christophe JAILLET
---
drivers/crypto/cavium/nitrox/nitrox_main.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/
'rc' is known to be 0 at this point.
If 'platform_get_resource()' or 'devm_ioremap()' fail, return -ENOMEM
instead of 0 which means success.
Signed-off-by: Christophe JAILLET
---
drivers/ata/ahci_da850.c | 8 ++--
1 file changed, 6 insertions(+), 2 deletion
’ may be used
uninitialized in this function"))
Signed-off-by: Christophe JAILLET
---
drivers/mcb/mcb-parse.c | 6 --
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/mcb/mcb-parse.c b/drivers/mcb/mcb-parse.c
index ee7fb6ec96bd..7369bda3442f 100644
--- a/drivers/mcb/m
If 'wiphy_new()' fails, we leak 'ops'. Add a new label in the error
handling path to free it in such a case.
Fixes: 5c22fb85102a7 ("brcmfmac: add wowl gtk rekeying offload support")
Signed-off-by: Christophe JAILLET
---
drivers/net/wireless/broadcom/brcm80211/brcmf
If 'wiphy_new()' fails, we leak 'ops'. Add a new label in the error
handling path to free it in such a case.
Cc: sta...@vger.kernel.org
Fixes: 5c22fb85102a7 ("brcmfmac: add wowl gtk rekeying offload support")
Signed-off-by: Christophe JAILLET
---
v2: Add CC tag
Le 12/10/2017 à 18:25, Bartlomiej Zolnierkiewicz a écrit :
[ added dri-devel ML to cc: ]
On Tuesday, September 12, 2017 07:39:30 AM Christophe JAILLET wrote:
If 'dmam_alloc_attrs()' fails, we must go through the error handling code,
as done elsewhere in this function. Otherwise,
We should propagate the error code returned by 'fb_alloc_cmap()' instead
of returning -EFAULT.
Signed-off-by: Christophe JAILLET
---
drivers/video/fbdev/au1200fb.c | 7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/video/fbdev/au1200fb.c b/drivers/v
Style clean-up.
Signed-off-by: Christophe JAILLET
---
drivers/video/fbdev/au1200fb.c | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/video/fbdev/au1200fb.c b/drivers/video/fbdev/au1200fb.c
index 687ea2a8f810..87d5a62bf6ca 100644
--- a/drivers/video/fbdev
nd won't install one.
This serie already goes further that the fixes I usually provide, so
please excuse me if I missed something or if it is somehow broken and/or
incomplete.
---
V1 previously posted is patch 3/8 of this serie
Christophe JAILLET (8):
video: fbdev: au1200fb: Fix a potential d
We should go through the error handling code instead of returning -ENOMEM
directly.
Signed-off-by: Christophe JAILLET
---
drivers/video/fbdev/au1200fb.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/video/fbdev/au1200fb.c b/drivers/video/fbdev/au1200fb.c
index
RQ")
So, remove it.
Signed-off-by: Christophe JAILLET
---
drivers/video/fbdev/au1200fb.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/video/fbdev/au1200fb.c b/drivers/video/fbdev/au1200fb.c
index cf54168d44dc..0d8ed0ef9183 100644
--- a/drivers/video/fbdev/au1200fb.c
+++ b/drivers/v
au1200fb_infos' array, we know that we
have released all what we needed to release. So we can 'break'.
Signed-off-by: Christophe JAILLET
---
drivers/video/fbdev/au1200fb.c | 12 ++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/video/fbdev/au1
There is no need to shut gcc up. It should not complain.
Axe 'fbdev', it is never used in this function.
Signed-off-by: Christophe JAILLET
---
drivers/video/fbdev/au1200fb.c | 6 --
1 file changed, 6 deletions(-)
diff --git a/drivers/video/fbdev/au1200fb.c b/drivers/video/fbdev/
.
This leads to a double free of 'fbi->pseudo_palette'.
Fix it by letting the caller free all resources in case of failure in
'au1200fb_init_fbinfo()'.
Signed-off-by: Christophe JAILLET
---
drivers/video/fbdev/au1200fb.c | 1 -
1 file changed, 1 deletion(-)
diff -
'ret' is known to be 0 at this point.
In case of memory allocation error in 'framebuffer_alloc()', return
-ENOMEM instead.
Signed-off-by: Christophe JAILLET
---
drivers/video/fbdev/au1200fb.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/vide
ode to
undo a previous 'request_firmware()', as already done in the other error
handling paths of the function.
Signed-off-by: Christophe JAILLET
---
We could certainly also propagate the error code returned by
'q6v5_xfer_mem_ownership()' instead of returning an unconditional -E
Le 31/10/2017 à 15:58, Boris Brezillon a écrit :
Hi Christophe,
On Sun, 22 Oct 2017 10:28:31 +0200
Christophe JAILLET wrote:
If 'chip->state == FL_SYNCING', we will 'goto retry' with the mutex
'&shared->lock' already taken.
In such a case, the 'm
ror handling path in the function.
The 2nd one removes some devm_iounmap/release/kfree functions which look
useless to me.
The 3rd one fixes a missing of_node_put.
The 4th one is just cosmetic and removes a useless message.
Christophe JAILLET (4):
fsl/fman: Remove a useless call to 'dev_
handling paths.
This is useless (priv->fixed_link is NULL at this point), but at least
it is consistent.
Signed-off-by: Christophe JAILLET
---
drivers/net/ethernet/freescale/fman/mac.c | 7 ++-
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/freescale/fm
Memory allocation functions already display some informaton in case of
memory allocation failure. There is no need to add an extra 'dev_err' here.
Signed-off-by: Christophe JAILLET
---
drivers/net/ethernet/freescale/fman/mac.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/d
If 'of_phy_find_device()' fails, we must undo the previous 'of_node_get()'
call, as done the the following error handling code.
Signed-off-by: Christophe JAILLET
---
drivers/net/ethernet/freescale/fman/mac.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/eth
Commit c6e26ea8c893 ("dpaa_eth: change device used") has removed usage of
'dev_set_drvdata()' in the 'mac_probe() function.
This call should also be axed.
Signed-off-by: Christophe JAILLET
---
drivers/net/ethernet/freescale/fman/mac.c | 1 -
1 file changed, 1 deletion
There is no need to have the 'struct nfcwilink *drv' variable static in the
probe function.
It only wastes a few bytes of memory.
Signed-off-by: Christophe JAILLET
---
drivers/nfc/nfcwilink.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/nfc/nfcwilink.c
Use 'of_property_read_u32()' instead of 'of_get_property()'+pointer
dereference in order to avoid access to potentially freed memory.
Use 'of_get_next_parent()' to simplify the while() loop and avoid the
need of a temp variable.
Signed-off-by: Christophe JAILLET
--
.
Signed-off-by: Christophe JAILLET
---
*** UNTESTED ***
---
arch/powerpc/kernel/prom.c | 9 -
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index bef76c5..dc4f6a4 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc
Le 15/10/2015 08:36, Michael Ellerman a écrit :
On Thu, 2015-10-15 at 07:56 +0200, Christophe JAILLET wrote:
Use 'of_property_read_u32()' instead of 'of_get_property()'+pointer
dereference in order to avoid access to potentially freed memory.
Use 'of_get_next_parent
Le 16/10/2015 11:49, Michael Ellerman a écrit :
On Fri, 2015-10-16 at 08:20 +0200, Christophe JAILLET wrote:
Le 15/10/2015 08:36, Michael Ellerman a écrit :
On Thu, 2015-10-15 at 07:56 +0200, Christophe JAILLET wrote:
Use 'of_property_read_u32()' instead of
'of_get_prop
Le 16/10/2015 12:02, Michael Ellerman a écrit :
As the kbuild robot detected you have left an extra "}" here.
I don't mind too much if you send patches that aren't compile tested, but you
might save yourself some time by compiling them.
Sorry about it, and thanks for your patience.
IMHO, this
.
Signed-off-by: Christophe JAILLET
---
v2: Fix missing '{'
*** COMPILE-TESTED ONLY ***
---
arch/powerpc/kernel/prom.c | 9 -
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index bef76c5..dc4f6a4 100644
--- a/ar
of_get_next_parent to simplify code.
Signed-off-by: Christophe JAILLET
---
v2: Fix missing '{'
v3: Use of_get_next_parent to simply code
*** COMPILE-TESTED ONLY ***
---
arch/powerpc/kernel/prom.c | 13 +
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/arch/powe
Reference to the 'np' node is dropped before dereferencing the 'sizep' and
'basep' pointers, which could by then point to junk if the node has been
freed.
Refactor code to call 'of_node_pup' later.
Signed-off-by: Christophe JAILLET
---
drivers/char
improve the names used.
Fixes: 92ae112e477a ("spi: orion: Fix clock resource by adding an optional bus
clock")
Signed-off-by: Christophe JAILLET
---
drivers/spi/spi-orion.c | 13 -
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/drivers/spi/spi-orion.c b/dr
irst 'kcalloc' fails. This is harmless.
- add a new label, err_delete_handle, in order to delete already
allocated handles in error handling path
- remove the now useless 'err' label
The way the code is now written will also delete the handles if the
'copy_to_user()
UARTn_FRAME_PARITY_ODD is 0x0300
UARTn_FRAME_PARITY_EVEN is 0x0200
So if the UART is configured for EVEN parity, it would be reported as ODD.
Fix it by correctly testing if the 2 bits are set.
Fixes: 3afbd89c9639 ("serial/efm32: add new driver")
Signed-off-by: Christophe JAILLET
-
ShareType value for equality instead.
Fixes: faaf946a7d5b ("CIFS: Add tree connect/disconnect capability for SMB2")
Signed-off-by: Christophe JAILLET
---
V2: use a 'switch' instead of some 'if'
The v1 and related comments are quite old. They can be found at:
http:
;ARM: davinci: PM: rework init, remove platform device")
Signed-off-by: Christophe JAILLET
---
This patch is just a *guess*. The end of the function looks more like a
error handling code rather than a normal path.
---
arch/arm/mach-davinci/pm.c | 1 +
1 file changed, 1 insertion(+)
diff --git
If 'sram_alloc' fails, we need to free already allocated resources.
Fixes: aa9aa1ec2df6 ("ARM: davinci: PM: rework init, remove platform device")
Signed-off-by: Christophe JAILLET
---
arch/arm/mach-davinci/pm.c | 5 -
1 file changed, 4 insertions(+), 1 deletion(-)
d
Le 13/05/2017 à 15:22, walter harms a écrit :
Am 13.05.2017 13:40, schrieb Christophe JAILLET:
This looks spurious to iounmap resources in the normal path of this init
function.
The 3 ioremap'ed fields of 'pm_config' can be accessed later on in other
functions, so it is likely
evm_ function to simplify code.
I've left the request_irq/free_irq because I'm unsure of potential side
effects if some other resources are freed while an IRQ can still be
triggered. So I've preferred to leave it as-is.
Christophe JAILLET (4):
usb: gadget: fotg210-udc: Remove a us
Use 'devm_kzalloc()' and 'devm_ioremap()' to simplify code.
While at it, turn some '== NULL' into shorter '!' when testing memory
allocation failure.
Signed-off-by: Christophe JAILLET
---
drivers/usb/gadget/udc/fotg210-udc.c | 25 --
pportunity to further simplify code.
(In fact, this change should be a no-op, because 'req' is the first field of
'struct fotg210_request'. So passing NULL would result in 'free(NULL)' in
'fotg210_ep_free_request()'. Anyway avoiding the goto is cleaner.)
The memory referenced by the 'fotg210->ep[]' array, is never freed.
So there is a memory leak in the error handling path of the probe function
and when the driver is unloaded.
Use 'devm_kzalloc()' to fix these leaks.
Signed-off-by: Christophe JAILLET
---
drivers/usb/gadge
There is no need to use an intermediate array for these memory allocations,
so, axe it.
While at it, turn a '== NULL' into a shorter '!' when testing memory
allocation failure.
Signed-off-by: Christophe JAILLET
---
drivers/usb/gadget/udc/fotg210-udc.c | 6 ++
1 file c
Reorder the error handling code in order to release the resources in
reverse order than allocation.
Introduce a new 'release_group' label in the error handling path and use
it to void some code duplication.
Signed-off-by: Christophe JAILLET
---
drivers/edac/mv64x60_edac.c | 7 -
'page_buf' and 'oob_buf' are allocated with 'devm_kzalloc()' and should not
have __iommem decoration.
Remove these decorations and some useless casting.
Signed-off-by: Christophe JAILLET
---
drivers/mtd/onenand/samsung.c | 12 ++--
1 file changed, 6 inser
Le 13/01/2018 à 15:22, Borislav Petkov a écrit :
+ Chris Packham who's been fixing some stuff in here too.
On Sat, Jan 13, 2018 at 08:28:21AM +0100, Christophe JAILLET wrote:
Reorder the error handling code in order to release the resources in
reverse order than allocation.
Introduce
'base_addr' has been mapped using 'pci_iomap()'. It should be freed with
the corresponding 'pci_iounmap()' instead of 'iomap()'.
Signed-off-by: Christophe JAILLET
---
drivers/scsi/3w-sas.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff
If the probing of the regulator is deferred, the memory allocated by
'mdiobus_alloc_size()' will be leaking.
It should be freed before the next call to 'sun4i_mdio_probe()' which will
reallocate it.
Fixes: 4bdcb1dd9feb ("net: Add MDIO bus driver for the Allwinner EMAC&qu
In some error handling paths, an error code is assiegned to 'ret'.
However, the function always return 0.
Fix it and return the error code if such an error paths is taken.
Fixes: 3d9ff34622ba ("ASoC: Intel: sst: add stream operations")
Signed-off-by: Christophe JAILLET
---
This patch fixes 3 small issues:
- missing 2nd '*' at the beginning of a doxygen comment
- extra space after a '\n' in a dev_dbg message
- extra tab before a 'return" statement
Signed-off-by: Christophe JAILLET
---
sound/soc/intel/atom/sst/sst_stream.c
he SP4_MACH_CRED flags in
nfs4_sp4_select_mode()")
Signed-off-by: Christophe JAILLET
---
Untested and not sure at all if correct...
---
fs/nfs/nfs4proc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 17a03f2c4330..ae00ac59f59b 100644
--
We should not call 'edac_mc_del_mc()' if a corresponding call to
'edac_mc_add_mc()' has not been performed yet.
So here, we should go to err instead of err2 to branch at the right place
of the error handling path.
Signed-off-by: Christophe JAILLET
---
drivers/edac/mv64x60_e
The labels and branching order of the error path of 'aspeed_adc_probe()'
are broken.
Re-order the labels and goto statements.
Signed-off-by: Christophe JAILLET
---
Not sure where it comes from.
Merge conflict incorrectly fixed?
---
drivers/iio/adc/aspeed_adc.c | 7 ---
1 file
'spi_alloc_master()' calls should be balanced by a 'spi_master_put()' call.
'spi_controller_put()' is equivalent (see include/linux/spi/spi.h) but it
is cleaner and more logical to use 'spi_master_put()'.
Signed-off-by: Christophe JAILLET
---
drivers/s
If an unlikely failure in 'of_get_regulator_init_data()' occurs, we must
release the reference on the current 'child' node before returning.
Signed-off-by: Christophe JAILLET
---
drivers/regulator/of_regulator.c | 1 +
1 file changed, 1 insertion(+)
diff --git
Le 15/01/2018 à 23:31, Michael Ellerman a écrit :
Chris Packham writes:
On 14/01/18 06:17, Christophe JAILLET wrote:
Le 13/01/2018 à 15:22, Borislav Petkov a écrit :
+ Chris Packham who's been fixing some stuff in here too.
On Sat, Jan 13, 2018 at 08:28:21AM +0100, Christophe JAILLET
'ret' is known to be 0 at this point. It must be updated by the value
returned by 'clk_prepare_enable()'.
Fixes: 0a886f59528a ("drm: zte: add initial vou drm driver")
Signed-off-by: Christophe JAILLET
---
drivers/gpu/drm/zte/zx_vou.c | 2 +-
1 file changed, 1 ins
If 'kzalloc' fails, we must free some memory before returning.
Fixes: 67f8b1dcb9ee ("net/mlx4_en: Refactor the XDP forwarding rings scheme")
Signed-off-by: Christophe JAILLET
---
drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 2 +-
1 file changed, 1 insertion(+), 1 delet
rrect number of
crtcs")
Signed-off-by: Christophe JAILLET
---
drivers/gpu/drm/sun4i/sun4i_drv.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c
b/drivers/gpu/drm/sun4i/sun4i_drv.c
index 4570da0227b4..d9a71f361b14 100644
--- a/d
Le 12/03/2018 à 09:42, Tariq Toukan a écrit :
>
>
> On 12/03/2018 12:45 AM, Christophe JAILLET wrote:
>> If 'kzalloc' fails, we must free some memory before returning.
>>
>> Fixes: 67f8b1dcb9ee ("net/mlx4_en: Refactor the XDP forwarding rings
>&g
Patch 1 and 3 are fixes.
Patch 2 is just a kind of clean-up noticed while patching this driver.
If patch 2 is considered as useless, patch 3 can be applied on top of
patch 1, it does nor depend on the 2nd patch.
Christophe JAILLET (3):
drm/meson: Fix an un-handled error path in
According to 'drivers/gpu/drm/drm_drv.c', 'drm_dev_unref()' is just a
compatibility alias for 'drm_dev_put()'. So use the latter instead.
Signed-off-by: Christophe JAILLET
---
drivers/gpu/drm/meson/meson_drv.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletion
'drm_vblank_init()' can fail. So handle this (unlikely) error.
Fixes: bbbe775ec5b5 ("drm: Add support for Amlogic Meson Graphic Controller")
Signed-off-by: Christophe JAILLET
---
drivers/gpu/drm/meson/meson_drv.c | 5 -
1 file changed, 4 insertions(+), 1 deletion(-)
If one of these functions fail, we whould free 'drm', as alreadry done in
the other error handling paths, below and above.
Fixes: bbbe775ec5b5 ("drm: Add support for Amlogic Meson Graphic Controller")
Signed-off-by: Christophe JAILLET
---
drivers/gpu/drm/me
Le 26/03/2018 à 19:16, Colin King a écrit :
From: Colin Ian King
Replace several allocation and memcpys with kmemdup and add in some
missing memory allocation failure checks. Also fix an incorrect
-EFAULT return with -ENOMEM.
Signed-off-by: Colin Ian King
---
drivers/staging/wilc1000/host_
'sca3000_configure_ring()' can fail, so test its return value and
propagate it if needed.
Signed-off-by: Christophe JAILLET
---
Same as v1
---
drivers/iio/accel/sca3000.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/iio/accel/sca3000.c b/drivers
Use 'devm_iio_kfifo_allocate()' instead of 'iio_kfifo_allocate()' in order
to simplify code and avoid a memory leak in an error path in
'sca3000_probe()'. A call to 'sca3000_unconfigure_ring()' was missing.
Signed-off-by: Christophe JAILLET
---
v2: Use a
All is said in the subject and below.
These patches are untested. Especially, patch 1 slightly changes the behavior
of 't4_read_write_register()'.
This looks logical to me, but please, review it carefully.
Christophe JAILLET (4):
HID: alps: Report an error if we receive inval
Better indent the code to improve readability.
Signed-off-by: Christophe JAILLET
---
drivers/hid/hid-alps.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/hid/hid-alps.c b/drivers/hid/hid-alps.c
index 137b963779c6..60d3950692d9 100644
--- a/drivers/hid/hid
If the data received is not what is expected, we should return an error.
Otherwise, we return 0 or a positive value which will be interpreted as
success, but '*read_val' has not been updated.
Fixes: 73196ebe134d ("HID: alps: add support for Alps T4 Touchpad device")
Signe
if 'read_flag' is false, there is no need to allocate and free memory.
We can simply avoid the memory allocation and pass NULL to kfree.
Signed-off-by: Christophe JAILLET
---
drivers/hid/hid-alps.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/hid/hi
If only the first 't4_read_write_register()' call fails, the error code
will be overwritten and lost.
Directly report the error instead.
While at it, log some errors if 't4_read_write_register()' fails, as done
in the rest of the driver.
Signed-off-by: Christophe JAILLET
For some reason, commit c0368e4db4a3 ("spi: bcm-qspi: Fix use after free
in bcm_qspi_probe() in error path") has updated some gotos, but not all of
them.
This looks spurious, so fix it.
Fixes: fa236a7ef240 ("spi: bcm-qspi: Add Broadcom MSPI driver")
Signed-off-by: Christop
Re-order error handling code and gotos to avoid leaks in error handling
paths.
Fixes: 9f946099fe19 ("regulator: gpio: fix parsing of gpio list")
Signed-off-by: Christophe JAILLET
---
drivers/regulator/gpio-regulator.c | 16 +++-
1 file changed, 7 insertions(+), 9 deletion
2 gotos in error handling paths branch to the wrong label.
Fix it.
Signed-off-by: Christophe JAILLET
---
drivers/staging/vme/devices/vme_user.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/vme/devices/vme_user.c
b/drivers/staging/vme/devices
Return 'err' in the error handling path instead of 0.
Return explicitly 0 in the normal path, instead of 'err', which is known
to be 0 at this point.
Fixes: fe1a56420cf2 ("net: lantiq: Add Lantiq / Intel VRX200 Ethernet driver")
Signed-off-by: Christophe JAIL
77686: stop validating rtc_time in .read_time")
Signed-off-by: Christophe JAILLET
---
drivers/rtc/rtc-max77686.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/rtc/rtc-max77686.c b/drivers/rtc/rtc-max77686.c
index 8a60900d6b8b..4aff349ae301 100644
--- a/drive
Signed-off-by: Christophe JAILLET
---
Not sure that the Fixes tag is the right one.
It is related, but not 100% accurate IMHO.
---
drivers/rtc/rtc-max8997.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/rtc/rtc-max8997.c b/drivers/rtc/rtc-max8997.c
index 08
In case of error, we return 0.
This is spurious and not consistent with the other functions of the driver.
Propagate the error code instead.
Signed-off-by: Christophe JAILLET
---
v2: re-word changelog and remove Fixes tag.
(not sure if any should be provided, and which one would be the best
1 - 100 of 1063 matches
Mail list logo