Drivers: hv: vmbus: Return -EINVAL for the sys files for unopened channels
authorDexuan Cui <decui@microsoft.com>
Thu, 13 Dec 2018 16:35:43 +0000 (16:35 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 29 Dec 2018 12:39:10 +0000 (13:39 +0100)
commitff53cc3576d3d728dec87e866c3ae84e33ef07a8
treec91fb9c540d24980b9de3d100c7971e759a8bff4
parentcc70f14956fa0ea84ee1a3a5b79347730c6c2d08
Drivers: hv: vmbus: Return -EINVAL for the sys files for unopened channels

commit fc96df16a1ce80cbb3c316ab7d4dc8cd5c2852ce upstream.

Before 98f4c651762c, we returned zeros for unopened channels.
With 98f4c651762c, we started to return random on-stack values.

We'd better return -EINVAL instead.

Fixes: 98f4c651762c ("hv: move ringbuffer bus attributes to dev_groups")
Cc: stable@vger.kernel.org
Cc: K. Y. Srinivasan <kys@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: Dexuan Cui <decui@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hv/vmbus_drv.c