> dinghao.liu@ wrote:
> > > Ira Weiny wrote:
> > > > Dinghao Liu wrote:
[snip]
> > > >
> > > > This does not quite work.
> > > >
> > > > free_arenas() is used in the error paths of create_arenas() and
> > > >
> Ira Weiny wrote:
> > Dinghao Liu wrote:
>
> [snip]
>
> -static int btt_freelist_init(struct arena_info *arena)
> +static int btt_freelist_init(struct device *dev, struct arena_info *arena)
>
> Both struct arena_info and struct btt contain references to struct nd
Use the scope based resource management (defined in
linux/cleanup.h) to automate resource lifetime
control on struct btt_sb *super in discover_arenas().
Signed-off-by: Dinghao Liu
---
Changelog:
v2: Set the __free attribute before kzalloc.
---
drivers/nvdimm/btt.c | 13 -
1 file
> > It's a little strange that we do not check super immediately after
> > allocation.
> > How about this:
> >
> > static int discover_arenas(struct btt *btt)
> > {
> > int ret = 0;
> > struct arena_info *arena;
> > - struct btt_sb *super;
> > size_t remaining = bt
>
> On 12/10/23 03:27, Dinghao Liu wrote:
> > Use the scope based resource management (defined in
> > linux/cleanup.h) to automate resource lifetime
> > control on struct btt_sb *super in discover_arenas().
> >
> > Signed-off-by: Dinghao Liu
&g
Use the scope based resource management (defined in
linux/cleanup.h) to automate resource lifetime
control on struct btt_sb *super in discover_arenas().
Signed-off-by: Dinghao Liu
---
drivers/nvdimm/btt.c | 12
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers
->freelist a leaked memory. Fix these memleaks by using
devm_kcalloc() to make the memory auto-freed on driver detach.
Fixes: 5212e11fde4d ("nd_btt: atomic sector updates")
Signed-off-by: Dinghao Liu
---
Changelog:
v2: -Use devm_kcalloc() to fix the memleaks.
-Fix the potential lea
> dinghao.liu@ wrote:
> > > Dave Jiang wrote:
>
> [snip]
>
> > > That said, this patch does not completely fix freelist from leaking in the
> > > following error path.
> > >
> > > discover_arenas()
> > > btt_freelist_init() -> ok (memory allocated)
> > > btt_rtt_init() -> f
> Dave Jiang wrote:
> >
>
> [snip]
>
> First off thanks for the patch. This code seems to have a few things to
> clean up.
>
> >
> > On 12/6/23 20:43, Dinghao Liu wrote:
> > > When an error happens in btt_freelist_init(), its caller
> &g
quot;nd_btt: atomic sector updates")
Signed-off-by: Dinghao Liu
---
drivers/nvdimm/btt.c | 15 +++
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/drivers/nvdimm/btt.c b/drivers/nvdimm/btt.c
index d5593b0dc700..d8c4ba8bfdda 100644
--- a/drivers/nvdimm/btt.c
+++ b/driv
54: Add CA8210 IEEE 802.15.4 device driver")
Signed-off-by: Dinghao Liu
---
Changelog:
v2: -Remove the first clk_unregister() instead of nulling priv->clk.
v3: -Simplify ca8210_register_ext_clock().
-Add a ';' after return in ca8210_unregister_ext_clock().
v4: -Remove an unu
t-20230929]
> > [If your patch is applied to the wrong git tree, kindly drop us a note.
> > And when submitting patch, we suggest to use '--base' as documented in
> > https://git-scm.com/docs/git-format-patch#_base_tree_information]
> >
> > url:
> > ht
54: Add CA8210 IEEE 802.15.4 device driver")
Signed-off-by: Dinghao Liu
---
Changelog:
v2: -Remove the first clk_unregister() instead of nulling priv->clk.
v3: -Simplify ca8210_register_ext_clock().
-Add a ';' after return in ca8210_unregister_ext_clock().
---
driv
> Missing Cc stable, this needs to be backported.
I will cc stable (sta...@vger.kernel.org) for the next version, thanks!
> > diff --git a/drivers/net/ieee802154/ca8210.c
> > b/drivers/net/ieee802154/ca8210.c
> > index aebb19f1b3a4..b35c6f59bd1a 100644
> > --- a/drivers/net/ieee802154/ca8210.c
>
54: Add CA8210 IEEE 802.15.4 device driver")
Signed-off-by: Dinghao Liu
---
Changelog:
v2: -Remove the first clk_unregister() instead of nulling priv->clk.
---
drivers/net/ieee802154/ca8210.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/ieee802154/
Hi Miquèl,
> > index aebb19f1b3a4..1d545879c000 100644
> > --- a/drivers/net/ieee802154/ca8210.c
> > +++ b/drivers/net/ieee802154/ca8210.c
> > @@ -2760,6 +2760,7 @@ static int ca8210_register_ext_clock(struct
> > spi_device *spi)
> > ret = of_clk_add_provider(np, of_clk_src_simple_get, priv->
ee may happen in the second time we call
clk_unregister().
Fix this by nulling priv->clk after the first clk_unregister(). Also
refine the pointer checking in ca8210_unregister_ext_clock().
Fixes: ded845a781a5 ("ieee802154: Add CA8210 IEEE 802.15.4 device driver")
Signed-off-by: Dingha
pport")
Signed-off-by: Dinghao Liu
---
Changelog:
v2: - Add a refcount increment to fix refcout leak instead of the
refcount decrement on error.
Set ctlr->auto_runtime_pm = true.
v3: - Add fix tag.
Add a return value check against pm_runtime_get_sync().
Mov
The error handling paths after pm_runtime_get_sync() has no
refcount decrement, which leads to refcount leak.
Signed-off-by: Dinghao Liu
---
Changelog:
v2: - Move the position of pm_runtime_enable,_get_sync().
Use devm_clk_register() to simplify error handling.
v2: - Use
pport")
Signed-off-by: Dinghao Liu
---
Changelog:
v2: - Add a refcount increment to fix refcout leak instead of the
refcount decrement on error.
Set ctlr->auto_runtime_pm = true.
v3: - Add fix tag.
Add a return value check against pm_runtime_get_sync().
Mov
> Hi Dinghao,
> On Mon, Apr 12, 2021 at 03:31:54PM +0800, Dinghao Liu wrote:
> > There is a PM usage counter decrement after zynqmp_qspi_init_hw()
> > without any refcount increment, which leads to refcount leak.Add
> > a refcount increment to balance the refcount. Also se
When clk_get_rate() fails, a pairing PM usage counter decrement
and disable is required to prevent refcount leak. It's the same
for the subsequent error paths. When of_clk_add_hw_provider()
fails, we need to unregister clk_hw.
Signed-off-by: Dinghao Liu
---
drivers/clk/renesas/rcar-usb2-
There is a PM usage counter decrement after zynqmp_qspi_init_hw()
without any refcount increment, which leads to refcount leak.Add
a refcount increment to balance the refcount. Also set
auto_runtime_pm to resume suspended spi controller.
Signed-off-by: Dinghao Liu
---
changelog:
v2: - Add a
When cdns3_gadget_start() fails, a pairing PM usage counter
decrement is needed to keep the counter balanced.
Signed-off-by: Dinghao Liu
---
Changelog:
v2: - Use pm_runtime_put_sync() to decrease refcount.
---
drivers/usb/cdns3/cdns3-gadget.c | 4 +++-
1 file changed, 3 insertions(+), 1
> On 21-04-07 13:22:26, Dinghao Liu wrote:
> > When cdns3_gadget_start() fails, a pairing PM usage counter
> > decrement is needed to keep the counter balanced.
> >
> > Signed-off-by: Dinghao Liu
> > ---
> > drivers/usb/cdns3/cdns3-gadget.c | 5 -
When lidar_write_control() fails, a pairing PM usage counter
decrement is needed to keep the counter balanced.
Fixes: 4ac4e086fd8c5 ("iio: pulsedlight-lidar-lite: add runtime PM")
Signed-off-by: Dinghao Liu
---
Changelog:
v2: - Add the fix tag.
---
drivers/iio/proximity/pulsedlight-
pm_runtime_get_sync() will increase the runtime PM counter
even it returns an error. Thus a pairing decrement is needed
to prevent refcount leak. Fix this by replacing this API with
pm_runtime_resume_and_get(), which will not change the runtime
PM counter on error.
Signed-off-by: Dinghao Liu
> On 08/04/2021 08:11, Dinghao Liu wrote:
> > pm_runtime_get_sync() will increase the rumtime PM counter
> > even it returns an error. Thus a pairing decrement is needed
> > to prevent refcount leak. Fix this by replacing this API with
> > pm_runtime_resume_and_get()
When v4l2_subdev_call() fails, a pairing PM usage counter
decrement is needed to keep the counter balanced. It's the
same for the following error paths in case 'enable' is on.
Signed-off-by: Dinghao Liu
---
Changelog:
v2: - Use pm_runtime_put() to balance the refcount.
---
> Hi Liu,
> Thanks for your patch.
>
> On Thu, Apr 08, 2021 at 05:08:27PM +0800, Dinghao Liu wrote:
> > When v4l2_subdev_call() fails, a pairing PM usage counter
> > decrement is needed to keep the counter balanced. It's the
> > same for the following
> Hi Dinghao,
>
> On 4/8/21 6:33 PM, Michal Simek wrote:
> > ++
> >
> > On 4/8/21 11:25 AM, Dinghao Liu wrote:
> >> When platform_get_irq() fails, a pairing PM usage counter
> >> increment is needed to keep the counter balanced. It's the
> &g
When platform_get_irq() fails, a pairing PM usage counter
increment is needed to keep the counter balanced. It's the
same for the following error paths.
Signed-off-by: Dinghao Liu
---
drivers/spi/spi-zynqmp-gqspi.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/spi/spi-z
When v4l2_subdev_call() fails, a pairing PM usage counter
decrement is needed to keep the counter balanced. It's the
same for the following error paths in case 'enable' is on.
Signed-off-by: Dinghao Liu
---
drivers/staging/media/imx/imx7-mipi-csis.c | 9 +++--
1 file change
When hmm_pool_register() fails, a pairing PM usage counter
increment is needed to keep the counter balanced. It's the
same for the following error paths.
Signed-off-by: Dinghao Liu
---
drivers/staging/media/atomisp/pci/atomisp_v4l2.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/dr
pm_runtime_get_sync() will increase the runtime PM counter
even it returns an error. Thus a pairing decrement is needed
to prevent refcount leak. Fix this by replacing this API with
pm_runtime_resume_and_get(), which will not change the runtime
PM counter on error.
Signed-off-by: Dinghao Liu
pm_runtime_get_sync() will increase the runtime PM counter
even it returns an error. Thus a pairing decrement is needed
to prevent refcount leak. Fix this by replacing this API with
pm_runtime_resume_and_get(), which will not change the runtime
PM counter on error.
Signed-off-by: Dinghao Liu
When slim_register_controller() fails, a pairing PM usage counter
increment is needed to keep the counter balanced.
Signed-off-by: Dinghao Liu
---
drivers/slimbus/qcom-ngd-ctrl.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/slimbus/qcom-ngd-ctrl.c b/drivers/slimbus/qcom-ngd
pm_runtime_get_sync() will increase the rumtime PM counter
even it returns an error. Thus a pairing decrement is needed
to prevent refcount leak. Fix this by replacing this API with
pm_runtime_resume_and_get(), which will not change the runtime
PM counter on error.
Signed-off-by: Dinghao Liu
pm_runtime_get_sync() will increase the rumtime PM counter
even it returns an error. Thus a pairing decrement is needed
to prevent refcount leak. Fix this by replacing this API with
pm_runtime_resume_and_get(), which will not change the runtime
PM counter on error.
Signed-off-by: Dinghao Liu
Some error paths in atomisp_open will execute PM runtime
decrement and unregister hmm pool even before we increase
the PM refcount and registration. Fix this by adjusting
jump labels on error.
Signed-off-by: Dinghao Liu
---
drivers/staging/media/atomisp/pci/atomisp_fops.c | 5 +++--
1 file
There is a rumtime PM imbalance between the error handling path
after devm_snd_soc_register_component() and all other error
handling paths. Add a PM runtime increment to balance refcount.
Signed-off-by: Dinghao Liu
---
Changelog:
v2: - Add a PM runtime increment to fix it instead of moving
> Hi Dinghao,
>
> On Wed, Apr 07, 2021 at 12:07:38PM +0800, Dinghao Liu wrote:
> > When mutex_lock_interruptible() fails, a pairing PM usage
> > counter decrement is needed to keep the counter balanced.
>
> Thank you for the patch.
>
> >
> > Signed
> On Wed, Apr 07, 2021 at 02:54:00PM +0800, Dinghao Liu wrote:
>
> > - pm_runtime_set_active(&client->dev);
> > - pm_runtime_set_autosuspend_delay(&client->dev, 1000);
> > - pm_runtime_use_autosuspend(&client->dev);
> > - pm_runtime_enab
There is a rumtime PM imbalance between the error handling path
after devm_snd_soc_register_component() and all other error
handling paths. Fix this by moving PM runtime decrement to the
end of the function.
Signed-off-by: Dinghao Liu
---
sound/soc/codecs/tas2552.c | 14 +++---
1 file
pm_runtime_get_sync() will increase the rumtime PM counter
even it returns an error. Thus a pairing decrement is needed
to prevent refcount leak. Fix this by replacing this API with
pm_runtime_resume_and_get(), which will not change the runtime
PM counter on error.
Signed-off-by: Dinghao Liu
pm_runtime_get_sync() will increase the rumtime PM counter
even it returns an error. Thus a pairing decrement is needed
to prevent refcount leak. Fix this by replacing this API with
pm_runtime_resume_and_get(), which will not change the runtime
PM counter on error.
Signed-off-by: Dinghao Liu
pm_runtime_get_sync() will increase the rumtime PM counter
even it returns an error. Thus a pairing decrement is needed
to prevent refcount leak. Fix this by replacing this API with
pm_runtime_resume_and_get(), which will not change the runtime
PM counter on error.
Signed-off-by: Dinghao Liu
When cdns3_gadget_start() fails, a pairing PM usage counter
decrement is needed to keep the counter balanced.
Signed-off-by: Dinghao Liu
---
drivers/usb/cdns3/cdns3-gadget.c | 5 -
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/cdns3/cdns3-gadget.c b/drivers/usb
pm_runtime_get_sync() will increase the rumtime PM counter
even it returns an error. Thus a pairing decrement is needed
to prevent refcount leak. Fix this by replacing this API with
pm_runtime_resume_and_get(), which will not change the runtime
PM counter on error.
Signed-off-by: Dinghao Liu
When lidar_write_control() fails, a pairing PM usage counter
decrement is needed to keep the counter balanced.
Signed-off-by: Dinghao Liu
---
drivers/iio/proximity/pulsedlight-lidar-lite-v2.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c
When mutex_lock_interruptible() fails, a pairing PM usage
counter decrement is needed to keep the counter balanced.
Signed-off-by: Dinghao Liu
---
drivers/input/mouse/cyapa.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/input/mouse/cyapa.c b/drivers/input/mouse
When devm_request_threaded_irq() fails, we should decrease the
runtime PM counter to keep the counter balanced. But when
iio_device_register() fails, we need not to decrease it because
we have already decreased it before.
Signed-off-by: Dinghao Liu
---
drivers/iio/light/gp2ap002.c | 5 +++--
1
pm_runtime_get_sync() will increase the rumtime PM counter
even it returns an error. Thus a pairing decrement is needed
to prevent refcount leak. Fix this by replacing this API with
pm_runtime_resume_and_get(), which will not change the runtime
PM counter on error.
Signed-off-by: Dinghao Liu
When prism2_hw_config() fails, we just return an error code
without any resource release, which may lead to memleak.
Signed-off-by: Dinghao Liu
---
drivers/net/wireless/intersil/hostap/hostap_cs.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless
ahc_lookup_scb() may return a null pointer and further lead to
null-pointer-dereference in case DATA_OVERRUN. Fix this by adding
a null check.
Signed-off-by: Dinghao Liu
---
drivers/scsi/aic7xxx/aic7xxx_core.c | 72 +++--
1 file changed, 37 insertions(+), 35 deletions
There are several em28xx_write_reg() and em28xx_write_reg_bits()
calls that we have caught their return values but lack further
handling. Check and return error on failure just like other calls
in em28xx_capture_start().
Signed-off-by: Dinghao Liu
---
drivers/media/usb/em28xx/em28xx-core.c | 9
There are two regmap_update_bits() calls but only one of them has
return value check, which is odd. Add a return value check and
terminate the execution flow on failure just like the other call.
Signed-off-by: Dinghao Liu
---
drivers/power/supply/axp20x_usb_power.c | 4 +++-
1 file changed, 3
The return value of ata_qc_from_tag() is checked in the whole
kernel except for two calls in sata_dwc_isr(), which may lead
to null-pointer-dereference. Add return value checks to avoid
such case.
Signed-off-by: Dinghao Liu
---
Changelog:
v2: - Refine commit message.
Add return value
> On Tue, Mar 2, 2021 at 9:34 AM wrote:
> > > On Mon, Mar 1, 2021 at 1:20 PM wrote:
> > > > > On Mon, Mar 1, 2021 at 9:44 AM Dinghao Liu
> > > > > wrote:
>
> ...
>
> > > > This issue is reported by my static analys
> On Mon, Mar 1, 2021 at 1:20 PM wrote:
> >
> > > On Mon, Mar 1, 2021 at 9:44 AM Dinghao Liu wrote:
> > > >
> > > > ata_qc_from_tag() may return a null pointer and further lead to
> > > > null-pointer-dereference. Add a return value check to
The use of dpot_read_r8d8() after checking dpot->uid is similar.
However, we check the return value and return an error code only
in one path, which is odd.
Signed-off-by: Dinghao Liu
---
drivers/misc/ad525x_dpot.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/m
"Jarkko Sakkinen" <jar...@kernel.org>写道:
> On Sun, Feb 28, 2021 at 05:32:30PM +0800, Dinghao Liu wrote:
> > The use of wait() in tpm_inf_recv() is almost the same. It's odd that
> > we only check the return value and terminate execution flow of one call.
> On Mon, Mar 1, 2021 at 9:44 AM Dinghao Liu wrote:
> >
> > ata_qc_from_tag() may return a null pointer and further lead to
> > null-pointer-dereference. Add a return value check to avoid such case.
>
> Can you elaborate more on this? Is it a real case?
> I have a
ahd_lookup_scb() may return a null pointer and further lead to
null pointer dereference in case DATA_OVERRUN. Fix this by adding
a null check.
Signed-off-by: Dinghao Liu
---
drivers/scsi/aic7xxx/aic79xx_core.c | 44 +++--
1 file changed, 23 insertions(+), 21 deletions
There is one vadc_poll_wait_eoc() call in vadc_do_conversion
that we have caught its return value but lack further handling.
Check and jump to err_disable label just like the other
vadc_poll_wait_eoc() in this function.
Signed-off-by: Dinghao Liu
---
drivers/iio/adc/qcom-spmi-vadc.c | 2 ++
1
There is one regmap_bulk_read() call in mpu3050_trigger_handler
that we have caught its return value bug lack further handling.
Check and terminate the execution flow just like the other three
regmap_bulk_read() calls in this function.
Signed-off-by: Dinghao Liu
---
drivers/iio/gyro/mpu3050
> On Sun, Feb 28, 2021 at 08:25:22PM +0800, Dinghao Liu wrote:
> > There is one il_set_tx_power() call in this function without
> > return value check. Print error message and return error code
> > on failure just like the other il_set_tx_power() call.
>
> We have fe
ata_qc_from_tag() may return a null pointer and further lead to
null-pointer-dereference. Add a return value check to avoid such case.
Signed-off-by: Dinghao Liu
---
drivers/ata/sata_dwc_460ex.c | 6 --
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/ata
There is one il_set_tx_power() call in this function without
return value check. Print error message and return error code
on failure just like the other il_set_tx_power() call.
Signed-off-by: Dinghao Liu
---
drivers/net/wireless/intel/iwlegacy/4965.c | 6 +-
1 file changed, 5 insertions
When vsi->type == I40E_VSI_FDIR, we have caught the return value of
i40e_vsi_request_irq() but without further handling. Check and execute
memory clean on failure just like the other i40e_vsi_request_irq().
Fixes: 8a9eb7d3cbcab ("i40e: rework fdir setup and teardown")
Signed-off-by
There is one e1e_wphy() call in e1000_set_d0_lplu_state_82571
that we have caught its return value but lack further handling.
Check and terminate the execution flow just like other e1e_wphy()
in this function.
Signed-off-by: Dinghao Liu
---
drivers/net/ethernet/intel/e1000e/82571.c | 2 ++
1
The use of wait() in tpm_inf_recv() is almost the same. It's odd that
we only check the return value and terminate execution flow of one call.
Signed-off-by: Dinghao Liu
---
drivers/char/tpm/tpm_infineon.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/cha
"Bernard Metzler" <b...@zurich.ibm.com>写道:
> -"Dinghao Liu" wrote: -
>
> >To: dinghao....@zju.edu.cn, k...@umn.edu
> >From: "Dinghao Liu"
> >Date: 02/26/2021 08:56AM
> >Cc: "Bernard Metzler" , "D
It's odd to adopt different error handling on failure of
pci_read_config_dword(). Check the return value and terminate
execution flow on failure of all pci_read_config_dword() calls
in this function.
Signed-off-by: Dinghao Liu
---
drivers/mmc/host/sdhci-pci-o2micro.c | 8
1
We should also check the range of opcode after calling
__rdmap_get_opcode() in the else branch to prevent potential
overflow.
Fixes: 8b6a361b8c482 ("rdma/siw: receive path")
Signed-off-by: Dinghao Liu
---
drivers/infiniband/sw/siw/siw_qp_rx.c | 10 ++
1 file changed, 10
>
> On 2/15/21 7:13 AM, Dinghao Liu wrote:
> > When cmd == SNDRV_PCM_TRIGGER_STOP, we should also check
> > the return value of skl_decoupled_trigger() just like what
> > we have done in case SNDRV_PCM_TRIGGER_PAUSE_RELEASE.
> >
> > Signed-off-by: Dinghao Liu
When cmd == SNDRV_PCM_TRIGGER_STOP, we should also check
the return value of skl_decoupled_trigger() just like what
we have done in case SNDRV_PCM_TRIGGER_PAUSE_RELEASE.
Signed-off-by: Dinghao Liu
---
sound/soc/intel/skylake/skl-pcm.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/sound
When device_type == DEVICE_ALI, we should also check the return
value of pci_iomap() to avoid potential null pointer dereference.
Signed-off-by: Dinghao Liu
---
sound/pci/intel8x0m.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sound/pci/intel8x0m.c b/sound/pci
When devm_kcalloc() fails, we should execute device_unregister()
to unregister edev->dev from system.
Fixes: 046050f6e623e ("extcon: Update the prototype of
extcon_register_notifier() with enum extcon")
Signed-off-by: Dinghao Liu
---
drivers/extcon/extcon.c | 1 +
1 file changed
Once we have called device_initialize(), we should use put_device() to
give up the reference on error, just like what we have done on failure
of device_add().
Signed-off-by: Dinghao Liu
---
Changelog:
v2: - Refine commit message.
v3: - Add '[v3]' to the title.
---
block/partitions/
Once we have called device_initialize(), we should use put_device() to
give up the reference on error, just like what we have done on failure
of device_add().
Signed-off-by: Dinghao Liu
---
Changelog:
v2: - Refine commit message.
---
block/partitions/core.c | 2 +-
1 file changed, 1 insertion
> On 1/15/21 11:34 PM, Dinghao Liu wrote:
> > Once we have called device_initialize(), we should
> > use put_device() to give up the reference on error,
> > just like what we have done on failure of device_add().
> >
> > Signed-off-by: Dinghao Liu
> Please cons
Once we have called device_initialize(), we should
use put_device() to give up the reference on error,
just like what we have done on failure of device_add().
Signed-off-by: Dinghao Liu
---
block/partitions/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block
When kmalloc() fails, tmp_tfm allocated by
crypto_alloc_shash() has not been freed, which
leads to memleak.
Fixes: d46eb3699502b ("evm: crypto hash replaced by shash")
Signed-off-by: Dinghao Liu
---
Changelog:
v2: - Remove checks against tmp_tfm before freeing.
---
security/int
> On Sun, Jan 10, 2021 at 01:27:09PM +0800, dinghao@zju.edu.cn wrote:
> > > On Sat, Jan 09, 2021 at 07:33:05PM +0800, Dinghao Liu wrote:
> > > > When kmalloc() fails, tmp_tfm allocated by
> > > > crypto_alloc_shash() has not been freed, which
> > &g
> On Sat, Jan 09, 2021 at 07:33:05PM +0800, Dinghao Liu wrote:
> > When kmalloc() fails, tmp_tfm allocated by
> > crypto_alloc_shash() has not been freed, which
> > leads to memleak.
> >
> > Fixes: d46eb3699502b ("evm: crypto hash replaced by
When register_pernet_subsys() fails, nf_nat_bysource
should be freed just like when nf_ct_extend_register()
fails.
Fixes: 1cd472bf036ca ("netfilter: nf_nat: add nat hook register functions to
nf_nat")
Signed-off-by: Dinghao Liu
---
net/netfilter/nf_nat_core.c | 1 +
1 file changed, 1
When kmalloc() fails, tmp_tfm allocated by
crypto_alloc_shash() has not been freed, which
leads to memleak.
Fixes: d46eb3699502b ("evm: crypto hash replaced by shash")
Signed-off-by: Dinghao Liu
---
security/integrity/evm/evm_crypto.c | 9 +++--
1 file changed, 7 insertions(+), 2
> On 05/01/2021 08:59, Dinghao Liu wrote:
> > When videobuf_waiton() fails, we should execute clean
> > functions to prevent memleak. It's the same when
> > __videobuf_copy_to_user() fails.
> >
> > Fixes: 7a7d9a89d0307 ("V4L/DVB (6251): Replac
> On Wed, 6 Jan 2021 18:56:23 +0800 (GMT+08:00) dinghao@zju.edu.cn
> wrote:
> > > I used this one for a test:
> > >
> > > https://patchwork.kernel.org/project/netdevbpf/patch/1609312994-121032-1-git-send-email-abaci-bug...@linux.alibaba.com/
> > >
> > > I'm not getting the Fixes tag when I do
> On Mon, 28 Dec 2020 16:14:17 -0500 Konstantin Ryabitsev wrote:
> > On Mon, Dec 28, 2020 at 01:05:26PM -0800, Florian Fainelli wrote:
> > > On 12/28/2020 12:23 PM, Konstantin Ryabitsev wrote:
> > > > On Thu, Dec 24, 2020 at 01:57:40PM -0800, Florian Fainelli wrote:
> > > Konstantin, would
When videobuf_waiton() fails, we should execute clean
functions to prevent memleak. It's the same when
__videobuf_copy_to_user() fails.
Fixes: 7a7d9a89d0307 ("V4L/DVB (6251): Replace video-buf to a more generic
approach")
Signed-off-by: Dinghao Liu
---
drivers/media/v4l2-core/
When crypto_shash_digestsize() fails, c->hmac_tfm
has not been freed before returning, which leads
to memleak.
Fixes: 49525e5eecca5 ("ubifs: Add helper functions for authentication support")
Signed-off-by: Dinghao Liu
---
fs/ubifs/auth.c | 2 +-
1 file changed, 1 insertion(+
When irq_domain_get_irq_data() or irqd_cfg() fails
at i == 0, data allocated by kzalloc() has not been
freed before returning, which leads to memleak.
Fixes: b106ee63abccb ("irq_remapping/vt-d: Enhance Intel IR driver to support
hierarchical irqdomains")
Signed-off-by: D
> On 1/3/21 2:22 PM, dinghao@zju.edu.cn wrote:
> >> On 2021/1/3 12:08, dinghao@zju.edu.cn wrote:
> >>>> Hi,
> >>>>
> >>>> On 2021/1/2 17:50, Dinghao Liu wrote:
> >>>>> When irq_domain_get_irq_data() or irq
> Dear Dinghao,
>
>
> Am 03.01.21 um 09:08 schrieb Dinghao Liu:
> > When ixgbe_fdir_write_perfect_filter_82599() fails,
> > input allocated by kzalloc() has not been freed,
> > which leads to memleak.
>
> Nice find. Thank you for your patches. Out of curiosit
When ixgbe_fdir_write_perfect_filter_82599() fails,
input allocated by kzalloc() has not been freed,
which leads to memleak.
Signed-off-by: Dinghao Liu
---
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 6 --
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net
> On 2021/1/3 12:08, dinghao@zju.edu.cn wrote:
> >> Hi,
> >>
> >> On 2021/1/2 17:50, Dinghao Liu wrote:
> >>> When irq_domain_get_irq_data() or irqd_cfg() fails
> >>> meanwhile i == 0, data allocated by kzalloc() has not
>
> Hi,
>
> On 2021/1/2 17:50, Dinghao Liu wrote:
> > When irq_domain_get_irq_data() or irqd_cfg() fails
> > meanwhile i == 0, data allocated by kzalloc() has not
> > been freed before returning, which leads to memleak.
> >
> > Fixes: b106ee63abccb ("ir
When irq_domain_get_irq_data() or irqd_cfg() fails
meanwhile i == 0, data allocated by kzalloc() has not
been freed before returning, which leads to memleak.
Fixes: b106ee63abccb ("irq_remapping/vt-d: Enhance Intel IR driver to support
hierarchical irqdomains")
Signed-off-by: D
1 - 100 of 381 matches
Mail list logo