dm: i2c: Add a missing memory allocaton check