From: Unsung Lee Date: Sun, 14 Jan 2024 11:05:21 +0000 (+0900) Subject: storage-external: Fix bug callback is triggered wrongly X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=70237d3a6681f9267ddbbb101f6e2b391e63c1ce;p=platform%2Fcore%2Fsystem%2Flibstorage.git storage-external: Fix bug callback is triggered wrongly Fix a bug callback is triggered wrongly when different storage's state is changed. Change-Id: Ia929a9d4cc7eee7990f79b73a8fe42cd7fca939b Signed-off-by: Unsung Lee --- diff --git a/src/storage-external.c b/src/storage-external.c index 65719d4..4406e4c 100755 --- a/src/storage-external.c +++ b/src/storage-external.c @@ -191,8 +191,12 @@ static int storage_ext_id_changed(storage_ext_device *dev, enum storage_ext_stat return ret; } - SYS_G_LIST_FOREACH(cb_list[STORAGE_CALLBACK_ID], elem, cb_info) + SYS_G_LIST_FOREACH(cb_list[STORAGE_CALLBACK_ID], elem, cb_info) { + if (dev->storage_id != cb_info->id) + continue; + cb_info->state_cb(cb_info->id, state, cb_info->user_data); + } return 0; }