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: Oded Gabbay <ogabbay@kernel.org> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Colin 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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Showing
Please register or sign in to comment