[openEuler-5.10-LTS 165/501] i2c: Fix a potential use after free