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:40:15 +0000 (13:40 +0100)
commitdac731412750b9f1a8abd2f7032ee0be841ed406
treebf27a855c1857d3d19204b376a59d766d2d195ef
parent1d060fede295f772f82f338fe2dcfe7daf41b3d5
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