Message ID | 20220420073119.16974-5-jgross@suse.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | tools/libs: don't set errno to negative values | expand |
On 20/04/2022 08:31, Juergen Gross wrote: > Setting errno to a negative value makes no sense. Fixes: e78e8b9bb649b > Signed-off-by: Juergen Gross <jgross@suse.com> Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
On 22.04.22 16:52, Andrew Cooper wrote: > On 20/04/2022 08:31, Juergen Gross wrote: >> Setting errno to a negative value makes no sense. > > Fixes: e78e8b9bb649b > >> Signed-off-by: Juergen Gross <jgross@suse.com> > > Acked-by: Andrew Cooper <andrew.cooper3@citrix.com> Do you want me to send the patches with the Fixes tags added? TBH I didn't bother to do the research for those, as the wrong values don't seem to cause any harm today. I just stumbled over the issues and thought it would be a good idea to fix those. Juergen
On 22/04/2022 15:55, Juergen Gross wrote: > On 22.04.22 16:52, Andrew Cooper wrote: >> On 20/04/2022 08:31, Juergen Gross wrote: >>> Setting errno to a negative value makes no sense. >> >> Fixes: e78e8b9bb649b >> >>> Signed-off-by: Juergen Gross <jgross@suse.com> >> >> Acked-by: Andrew Cooper <andrew.cooper3@citrix.com> > > Do you want me to send the patches with the Fixes tags added? > > TBH I didn't bother to do the research for those, as the wrong values > don't seem to cause any harm today. I just stumbled over the issues > and thought it would be a good idea to fix those. Given that there's nothing else to adjust, I was thinking of just fixing them on commit. But we should backport these to all appropriate releases (cc Jan). ~Andrew
diff --git a/tools/libs/light/libxl_linux.c b/tools/libs/light/libxl_linux.c index 8d62dfd255..27f2bce718 100644 --- a/tools/libs/light/libxl_linux.c +++ b/tools/libs/light/libxl_linux.c @@ -288,7 +288,7 @@ int libxl__pci_topology_init(libxl__gc *gc, if (i == num_devs) { LOG(ERROR, "Too many devices"); err = ERROR_FAIL; - errno = -ENOSPC; + errno = ENOSPC; goto out; }
Setting errno to a negative value makes no sense. Signed-off-by: Juergen Gross <jgross@suse.com> --- tools/libs/light/libxl_linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)