Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1526110 > unrolled thread

[PATCH] xen-scsifront: Add a missing call to kfree

Started byQuentin Lambert <lambert.quentin@gmail.com>
First post2016-11-19 19:30 +0100
Last post2016-11-24 09:30 +0100
Articles 5 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] xen-scsifront: Add a missing call to kfree Quentin Lambert <lambert.quentin@gmail.com> - 2016-11-19 19:30 +0100
    Re: [PATCH] xen-scsifront: Add a missing call to kfree Juergen Gross <jgross@suse.com> - 2016-11-21 07:10 +0100
      Re: [PATCH] xen-scsifront: Add a missing call to kfree "Martin K. Petersen" <martin.petersen@oracle.com> - 2016-11-22 04:50 +0100
        Re: [PATCH] xen-scsifront: Add a missing call to kfree Juergen Gross <jgross@suse.com> - 2016-11-22 06:30 +0100
    Re: [PATCH] xen-scsifront: Add a missing call to kfree Juergen Gross <jgross@suse.com> - 2016-11-24 09:30 +0100

#1526110 — [PATCH] xen-scsifront: Add a missing call to kfree

FromQuentin Lambert <lambert.quentin@gmail.com>
Date2016-11-19 19:30 +0100
Subject[PATCH] xen-scsifront: Add a missing call to kfree
Message-ID<sFiyK-5C-51@gated-at.bofh.it>
Most error branches following the call to kmalloc contain
a call to kfree. This patch add these calls where they are
missing.

This issue was found with Hector.

Signed-off-by: Quentin Lambert <lambert.quentin@gmail.com>

---
 drivers/scsi/xen-scsifront.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/scsi/xen-scsifront.c
+++ b/drivers/scsi/xen-scsifront.c
@@ -627,6 +627,7 @@ static int scsifront_action_handler(stru
 
 	if (scsifront_enter(info)) {
 		spin_unlock_irq(host->host_lock);
+		kfree(shadow);
 		return FAILED;
 	}
 

[toc] | [next] | [standalone]


#1526375

FromJuergen Gross <jgross@suse.com>
Date2016-11-21 07:10 +0100
Message-ID<sFPXI-5Q1-5@gated-at.bofh.it>
In reply to#1526110
On 19/11/16 19:22, Quentin Lambert wrote:
> Most error branches following the call to kmalloc contain
> a call to kfree. This patch add these calls where they are
> missing.
> 
> This issue was found with Hector.
> 
> Signed-off-by: Quentin Lambert <lambert.quentin@gmail.com>

Nice catch. I think this will need some more work, I'll do a
follow-on patch.

Reviewed-by: Juergen Gross <jgross@suse.com>

> 
> ---
>  drivers/scsi/xen-scsifront.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> --- a/drivers/scsi/xen-scsifront.c
> +++ b/drivers/scsi/xen-scsifront.c
> @@ -627,6 +627,7 @@ static int scsifront_action_handler(stru
>  
>  	if (scsifront_enter(info)) {
>  		spin_unlock_irq(host->host_lock);
> +		kfree(shadow);
>  		return FAILED;
>  	}
>  
> 

[toc] | [prev] | [next] | [standalone]


#1527206

From"Martin K. Petersen" <martin.petersen@oracle.com>
Date2016-11-22 04:50 +0100
Message-ID<sGafM-1Ox-11@gated-at.bofh.it>
In reply to#1526375
>>>>> "Juergen" == Juergen Gross <jgross@suse.com> writes:

Juergen,

Juergen> On 19/11/16 19:22, Quentin Lambert wrote:
>> Most error branches following the call to kmalloc contain a call to
>> kfree. This patch add these calls where they are missing.
>> 
>> This issue was found with Hector.
>> 
>> Signed-off-by: Quentin Lambert <lambert.quentin@gmail.com>

Juergen> Nice catch. I think this will need some more work, I'll do a
Juergen> follow-on patch.

Juergen> Reviewed-by: Juergen Gross <jgross@suse.com>

Are you taking this patch through the Xen tree or should I queue it up?

-- 
Martin K. Petersen	Oracle Linux Engineering

[toc] | [prev] | [next] | [standalone]


#1527235

FromJuergen Gross <jgross@suse.com>
Date2016-11-22 06:30 +0100
Message-ID<sGbOC-2Vy-7@gated-at.bofh.it>
In reply to#1527206
On 22/11/16 04:40, Martin K. Petersen wrote:
>>>>>> "Juergen" == Juergen Gross <jgross@suse.com> writes:
> 
> Juergen,
> 
> Juergen> On 19/11/16 19:22, Quentin Lambert wrote:
>>> Most error branches following the call to kmalloc contain a call to
>>> kfree. This patch add these calls where they are missing.
>>>
>>> This issue was found with Hector.
>>>
>>> Signed-off-by: Quentin Lambert <lambert.quentin@gmail.com>
> 
> Juergen> Nice catch. I think this will need some more work, I'll do a
> Juergen> follow-on patch.
> 
> Juergen> Reviewed-by: Juergen Gross <jgross@suse.com>
> 
> Are you taking this patch through the Xen tree or should I queue it up?

I'm taking it through the xen tree, thanks.


Juergen

[toc] | [prev] | [next] | [standalone]


#1529056

FromJuergen Gross <jgross@suse.com>
Date2016-11-24 09:30 +0100
Message-ID<sGXzQ-ck-23@gated-at.bofh.it>
In reply to#1526110
On 19/11/16 19:22, Quentin Lambert wrote:
> Most error branches following the call to kmalloc contain
> a call to kfree. This patch add these calls where they are
> missing.
> 
> This issue was found with Hector.
> 
> Signed-off-by: Quentin Lambert <lambert.quentin@gmail.com>

Applied to xen/tip.git for-linus-4.10


Juergen

> 
> ---
>  drivers/scsi/xen-scsifront.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> --- a/drivers/scsi/xen-scsifront.c
> +++ b/drivers/scsi/xen-scsifront.c
> @@ -627,6 +627,7 @@ static int scsifront_action_handler(stru
>  
>  	if (scsifront_enter(info)) {
>  		spin_unlock_irq(host->host_lock);
> +		kfree(shadow);
>  		return FAILED;
>  	}
>  
> 
> 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web