[PATCH] xen-scsifront: Add a missing call to kfree
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 --- 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; } -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] xen-scsifront: Add a missing call to kfree
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 Nice catch. I think this will need some more work, I'll do a follow-on patch. Reviewed-by: Juergen Gross > > --- > 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; > } > > -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] xen-scsifront: Add a missing call to kfree
> "Juergen" == Juergen Gross 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 Juergen> Nice catch. I think this will need some more work, I'll do a Juergen> follow-on patch. Juergen> Reviewed-by: Juergen Gross Are you taking this patch through the Xen tree or should I queue it up? -- Martin K. Petersen Oracle Linux Engineering -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] xen-scsifront: Add a missing call to kfree
On 22/11/16 04:40, Martin K. Petersen wrote: >> "Juergen" == Juergen Gross 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 > > Juergen> Nice catch. I think this will need some more work, I'll do a > Juergen> follow-on patch. > > Juergen> Reviewed-by: Juergen Gross > > 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 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] xen-scsifront: Add a missing call to kfree
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 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; > } > > > -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] xen-scsifront: Add a missing call to kfree
On Mon, Nov 21, 2016 at 07:01:36AM +0100, Juergen Gross wrote: > 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 > > Nice catch. I think this will need some more work, I'll do a > follow-on patch. Yeah. It's weird how we free it on the success path and all the failure paths except one. But it looks so deliberate. What's going on with that? Could you send your follow on patch as a reply to the thread? regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] xen-scsifront: Add a missing call to kfree
On Mon, Nov 21, 2016 at 07:01:36AM +0100, Juergen Gross wrote: > 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 > > Nice catch. I think this will need some more work, I'll do a > follow-on patch. > The error handling is really weird. Could you send your follow on to this thread? regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] xen-scsifront: Add a missing call to kfree
On 05/12/16 21:53, Dan Carpenter wrote: > On Mon, Nov 21, 2016 at 07:01:36AM +0100, Juergen Gross wrote: >> 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 >> >> Nice catch. I think this will need some more work, I'll do a >> follow-on patch. >> > > The error handling is really weird. Could you send your follow on to > this thread? I did: https://lkml.org/lkml/2016/12/2/17 Juergen -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] xen-scsifront: Add a missing call to kfree
Oops. Sorry for the noise. regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html