habanalabs/gaudi: Fix uninitialized return code rc when read size is zero
In the case where size is zero the while loop never assigns rc and the return value is uninitialized. Fix this by initializing rc to zero. Fixes: 639781dc ("habanalabs/gaudi: add debugfs to DMA from the device") Reviewed-by: NOded Gabbay <ogabbay@kernel.org> Acked-by: NArnd Bergmann <arnd@arndb.de> Signed-off-by: NColin Ian King <colin.king@canonical.com> Addresses-Coverity: ("Uninitialized scalar variable") Link: https://lore.kernel.org/r/20210412161012.1628202-1-colin.king@canonical.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Showing
想要评论请 注册 或 登录