habanalabs: prevent user buff overflow
authorMoti Haimovski <mhaimovski@habana.ai>
Wed, 19 Aug 2020 14:40:33 +0000 (17:40 +0300)
committerOded Gabbay <oded.gabbay@gmail.com>
Mon, 31 Aug 2020 12:10:27 +0000 (15:10 +0300)
commit6396feabf7a4104a4ddfecc00b8aac535c631a66
treedb334ddac88a5e85ebdc9d9737274f87373fd00d
parentf75aef392f869018f78cfedf3c320a6b3fcfda6b
habanalabs: prevent user buff overflow

This commit fixes a potential debugfs issue that may occur when
reading the clock gating mask into the user buffer since the
user buffer size was not taken into consideration.

Signed-off-by: Moti Haimovski <mhaimovski@habana.ai>
Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
drivers/misc/habanalabs/common/debugfs.c