linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rajkumar Manoharan <rmanohar@codeaurora.org>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: kvalo@codeaurora.org, davem@davemloft.net,
	pradeepc@codeaurora.org, ath11k@lists.infradead.org,
	linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
	linux-wireless-owner@vger.kernel.org
Subject: Re: [PATCH] ath11k: Fix some resource leaks in error path in 'ath11k_thermal_register()'
Date: Wed, 13 May 2020 14:22:58 -0700	[thread overview]
Message-ID: <8ee716c797a547165132c179c1909404@codeaurora.org> (raw)
In-Reply-To: <20200513201454.258111-1-christophe.jaillet@wanadoo.fr>

On 2020-05-13 13:14, Christophe JAILLET wrote:
> If 'thermal_cooling_device_register()' fails, we must undo what has 
> been
> allocated so far. So we must go to 'err_thermal_destroy' instead of
> returning directly
> 
> In case of error in 'ath11k_thermal_register()', the previous
> 'thermal_cooling_device_register()' call must also be undone. Move the
> 'ar->thermal.cdev = cdev' a few lines above in order for this to be 
> done
> in 'ath11k_thermal_unregister()' which is called in the error handling
> path.
> 
> Fixes: 2a63bbca06b2 ("ath11k: add thermal cooling device support")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> I'm not 100% confident with this patch.
> 
> - When calling 'ath11k_thermal_unregister()', we try to release some
>   resources that have not been allocated yet. I don't know if it can be 
> an
>   issue or not.
> - I think that we should propagate the error code, instead of forcing
>   -EINVAL.
> 
Good catch.

-Rajkumar

  reply	other threads:[~2020-05-13 21:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-13 20:14 [PATCH] ath11k: Fix some resource leaks in error path in 'ath11k_thermal_register()' Christophe JAILLET
2020-05-13 21:22 ` Rajkumar Manoharan [this message]
2020-05-19  6:56 ` Kalle Valo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8ee716c797a547165132c179c1909404@codeaurora.org \
    --to=rmanohar@codeaurora.org \
    --cc=ath11k@lists.infradead.org \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=davem@davemloft.net \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kvalo@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless-owner@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pradeepc@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).