Fix incorrect check on null pointer after a kzalloc
Currently device is being allocated but buffer is being used to check for a failed allocation. Fix this by checking if device is null rather than buffer.
Addresses-Coverity: ("Logically dead code") Signed-off-by: Colin Ian King colin.king@canonical.com