mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-16 06:19:24 +00:00
dm: hw: Replace sscanf with permitted string API
Replace sscanf in device model hw directory Tracked-On: #2079 Signed-off-by: Long Liu <long.liu@intel.com> Reviewed-by: Shuo A Liu <shuo.a.liu@intel.com> Reviewed-by: <yonghua.huang@intel.com> Acked-by: Yu Wang <yu1.wang@intel.com>
This commit is contained in:
@@ -1003,7 +1003,7 @@ passthru_init(struct vmctx *ctx, struct pci_vdev *dev, char *opts)
|
||||
}
|
||||
|
||||
opt = strsep(&opts, ",");
|
||||
if (sscanf(opt, "%x/%x/%x", &bus, &slot, &func) != 3) {
|
||||
if (parse_bdf(opt, &bus, &slot, &func, 16) != 0) {
|
||||
warnx("Invalid passthru BDF options:%s", opt);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
Reference in New Issue
Block a user