getline returns the number of characters read, so check for ret < 0 instead of ret. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>