[PATCH openEuler-1.0-LTS 2/2] driver: base: fix UAF when driver_attach failed