Handle sensors that can not be found in SystemManager

When a sensor id is not managed in yaml the code tries to get it from
legacy SystemManager;
And when the sensor id can not be found in SystemManager, it returns
empty path, and cause segment fault.

This commit makes it return -EINVAL when path is empty, and thus the
code will handle this case properly without crash.

Resolves openbmc/openbmc#3062

Tested: Boot host without ipmid crash on Romulus.

Change-Id: I4240b9be54824543b5e795e898330aeb02c5eb90
Signed-off-by: Lei YU <mine260309@gmail.com>
1 file changed