usb-device: Fix mismatch add/remove object

The node added and remove does not match which would result in the
entries not being removed properly. Also fixed nullptr access for char*
which can cause sdbus property error.

Tested:
```
$ USB device removed with dev node: /dev/bus/usb/001/114
USB device removed with dev node: /dev/bus/usb/001/117
USB device removed with dev node: /dev/bus/usb/001/116
USB device removed with dev node: /dev/bus/usb/001/115
USB device removed with dev node: /dev/bus/usb/001/113
USB device removed with dev node: /dev/bus/usb/001/110
USB device removed with dev node: /dev/bus/usb/001/104
USB device removed with dev node: /dev/bus/usb/001/106
USB device removed with dev node: /dev/bus/usb/001/107
USB device removed with dev node: /dev/bus/usb/001/108
USB device removed with dev node: /dev/bus/usb/001/109
USB device removed with dev node: /dev/bus/usb/001/105

$ Adding /xyz/openbmc_project/devices/_2f1_2d1_2e5 -> /dev/bus/usb/001/005
Adding /xyz/openbmc_project/devices/_2f1_2d1_2e6 -> /dev/bus/usb/001/006
Adding /xyz/openbmc_project/devices/_2f1_2d1_2e6_2e1 -> /dev/bus/usb/001/007
Adding /xyz/openbmc_project/devices/_2f1_2d1_2e6_2e2 -> /dev/bus/usb/001/008
Adding /xyz/openbmc_project/devices/_2f1_2d1_2e6_2e3 -> /dev/bus/usb/001/009
Adding /xyz/openbmc_project/devices/_2f1_2d1_2e6_2e4 -> /dev/bus/usb/001/010
```
Removing and adding usb devices without the daemon crashing.

Google-Bug-Id: 311478549
Change-Id: I55e6befba51fda72d4343db906c07f0f29d951d3
Signed-off-by: Willy Tu <wltu@google.com>
(cherry picked from commit 5f15f30a4d98a0f08b35115e7858c816f8927fa8)
1 file changed
tree: 20440e623b44fdbf462e7cd194004d54fe7895b8
  1. conf/
  2. dynamic-layers/
  3. meta-nuvoton-npcm8xx/
  4. recipes-bsp/
  5. recipes-connectivity/
  6. recipes-core/
  7. recipes-devtools/
  8. recipes-extended/
  9. recipes-google/
  10. recipes-kernel/
  11. recipes-phosphor/
  12. recipes-support/
  13. LICENSE
  14. README.md
README.md

meta-gbmc-staging

This repository contains additions to the openbmc/meta-google layer that are not yet ready for OpenBMC inclusion.

How to use this layer

  1. Clone openbmc/openbmc from GitHub.
  2. Clone this layer from GitHub into a subdirectory of openbmc.