RE: [PATCH 1/1] Drivers: hv: vmbus: Don't leak channel ids

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> From: linux-kernel-owner@xxxxxxxxxxxxxxx [mailto:linux-kernel-
> owner@xxxxxxxxxxxxxxx] On Behalf Of kys@xxxxxxxxxxxxxxxxxxxxxx
> 
> diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c
> index e1a3ae4..0a85246 100644
> --- a/drivers/hv/channel_mgmt.c
> +++ b/drivers/hv/channel_mgmt.c
> @@ -802,6 +802,7 @@ static void vmbus_onoffer(struct
> vmbus_channel_message_header *hdr)
>         /* Allocate the channel object and save this offer. */
>         newchannel = alloc_channel();
>         if (!newchannel) {
> +               vmbus_release_relid(offer->child_relid);
>                 pr_err("Unable to allocate channel object\n");
>                 return;
>         }

The patch seems good.

BTW,  vmbus_onoffer -> alloc_channel is only called in the workqueue
context, so maybe we should change the atomic kzalloc in alloc_channel
to GFP_KERNEL?

Thanks,
-- Dexuan





[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]