search for: erange

Displaying 20 results from an estimated 213 matches for "erange".

Did you mean: range
2011 Apr 13
1
[PATCH hivex] maint: split long lines
...LT; return NULL; @@ -733,7 +736,8 @@ get_children (hive_h *h, hive_node_h node, /* Arbitrarily limit the number of subkeys we will ever deal with. */ if (nr_subkeys_in_nk > HIVEX_MAX_SUBKEYS) { if (h->msglvl >= 2) - fprintf (stderr, "hivex: get_children: returning ERANGE because nr_subkeys_in_nk > HIVEX_MAX_SUBKEYS (%zu > %d)\n", + fprintf (stderr, "hivex: get_children: returning ERANGE because " + "nr_subkeys_in_nk > HIVEX_MAX_SUBKEYS (%zu > %d)\n", nr_subkeys_in_nk, HIVEX_MAX_SUBKEYS); errno =...
2017 May 20
3
[RFC PATCH 0/3] drm/nouveau/dispnv04 overlay and primary fb format fixes
This came out of some debugging I was doing to figure out how BE mode works on this hardware. Among other things, it came out that we're not exposing 16-bpp mode support and that the ARGB8888 mode that we do expose is broken. Also the overlay logic was pretty broken, I must have only tested with very "normal" overlay buffer sizes with modetest before. That said, this code has only
2020 Mar 26
0
[PATCH nbdkit 5/9 patch split 2/5] lib: Move code for parsing, passwords and paths into libnbdkit.so.
...\ - return 0 - -/* Functions for parsing signed integers. */ -int -nbdkit_parse_int (const char *what, const char *str, int *rp) -{ - long r; - char *end; - - errno = 0; - r = strtol (str, &end, 0); -#if INT_MAX != LONG_MAX - if (r < INT_MIN || r > INT_MAX) - errno = ERANGE; -#endif - PARSE_COMMON_TAIL; -} - -int -nbdkit_parse_int8_t (const char *what, const char *str, int8_t *rp) -{ - long r; - char *end; - - errno = 0; - r = strtol (str, &end, 0); - if (r < INT8_MIN || r > INT8_MAX) - errno = ERANGE; - PARSE_COMMON_TAIL; -} - -int -nbdkit_parse_i...
2017 May 20
4
[RFC PATCH 0/3] drm/nouveau/dispnv04 overlay and primary fb format fixes
This came out of some debugging I was doing to figure out how BE mode works on this hardware. Among other things, it came out that we're not exposing 16-bpp mode support and that the ARGB8888 mode that we do expose is broken. Also the overlay logic was pretty broken, I must have only tested with very "normal" overlay buffer sizes with modetest before. That said, this code has only
2017 Aug 06
4
[PATCH 0/4] Overlay / format improvements
This was all kicked off by me figuring out how the PPC byteswap thing worked. In the end, we're keeping the implicit byteswap based on architecture, but also expose the correctly supported formats, and fix some overlay details. Overlay framebuffers have various funky requirements that should be enforced at framebuffer creation time (these are set apart by their YUV formats). Further, I
2019 Sep 23
0
Re: [PATCH nbdkit] server: public: Add nbdkit_parse_* functions for safely parsing integers.
...signed integers. */ > +int > +nbdkit_parse_int (const char *what, const char *str, int *rp) > +{ > + long r; > + char *end; > + > + errno = 0; > + r = strtol (str, &end, 0); > +#if INT_MAX != LONG_MAX > + if (r < INT_MIN || r > INT_MAX) > + errno = ERANGE; > +#endif > + PARSE_COMMON_TAIL; > +} Looks correct. > + > +int > +nbdkit_parse_long (const char *what, const char *str, long *rp) > +{ > + long r; > + char *end; > + > + errno = 0; > + r = strtol (str, &end, 0); > + PARSE_COMMON_TAIL; > +} I...
2013 Nov 15
4
[PATCH 1/5] drm/nv10/plane: fix format computation
Otherwise none of the format checks pass, since the width was still in 16.16 encoding. Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu> --- This must have been some sort of last-second cleanup I made and forgot to test, because with this code, there's no way it could ever have worked... drivers/gpu/drm/nouveau/dispnv04/overlay.c | 17 +++++++++-------- 1 file changed, 9
2023 Jan 26
2
[Bridge] [PATCH net-next] netlink: provide an ability to set default extack message
...; NL_SET_ERR_MSG_MOD(extack, "Offloading not supported"); err = 0; } Imagine (not the case here) that below such a "warning extack" lies something like this: if (arg > range) { NL_SET_ERR_MSG_MOD(extack, "Argument outside expected range"); return -ERANGE; } What you'll get is: Error: Offloading not supported (error code -ERANGE). whereas before, we relied on any NL_SET_ERR_MSG_MOD() call to overwrite the "warning" extack, and that to only be shown on error code 0. Also, if we make this change this way, there's no going back (...
2019 Sep 21
2
[PATCH nbdkit] server: public: Add nbdkit_parse_* functions for safely parsing integers.
...\ + return 0 + +/* Functions for parsing signed integers. */ +int +nbdkit_parse_int (const char *what, const char *str, int *rp) +{ + long r; + char *end; + + errno = 0; + r = strtol (str, &end, 0); +#if INT_MAX != LONG_MAX + if (r < INT_MIN || r > INT_MAX) + errno = ERANGE; +#endif + PARSE_COMMON_TAIL; +} + +int +nbdkit_parse_long (const char *what, const char *str, long *rp) +{ + long r; + char *end; + + errno = 0; + r = strtol (str, &end, 0); + PARSE_COMMON_TAIL; +} + +int +nbdkit_parse_int16_t (const char *what, const char *str, int16_t *rp) +{ + long r...
2019 Jan 25
0
[klibc:update-dash] mystring: fix "Illegal number" on FreeBSD & macOS for x=; echo $((x))
...$((x)) Op 07-03-18 om 06:26 schreef Herbert Xu: > Martijn Dekker <martijn at inlv.org> wrote: >> >>> Since base is always a constant 0 or a constant 10, never a >>> user-provided value, the only error that strtoimax will ever report on >>> glibc systems is ERANGE. Checking only ERANGE therefore preserves the >>> glibc behaviour, and allows the exact same set of errors to be detected >>> on non-glibc systems. >> >> That makes sense, thanks. > > Could you resend your patch with this change please? OK, see below. - M. Sig...
2020 Mar 28
0
[klibc:update-dash] dash: mystring: fix "Illegal number" on FreeBSD & macOS for x=; echo $((x))
...7fd1 ] Op 07-03-18 om 06:26 schreef Herbert Xu: > Martijn Dekker <martijn at inlv.org> wrote: >> >>> Since base is always a constant 0 or a constant 10, never a >>> user-provided value, the only error that strtoimax will ever report on >>> glibc systems is ERANGE. Checking only ERANGE therefore preserves the >>> glibc behaviour, and allows the exact same set of errors to be detected >>> on non-glibc systems. >> >> That makes sense, thanks. > > Could you resend your patch with this change please? OK, see below. - M. Sig...
2013 Nov 15
0
[PATCH 2/5] drm/nv10/plane: add downscaling restrictions
...a305..c14afb7 100644 --- a/drivers/gpu/drm/nouveau/dispnv04/overlay.c +++ b/drivers/gpu/drm/nouveau/dispnv04/overlay.c @@ -112,7 +112,15 @@ nv10_update_plane(struct drm_plane *plane, struct drm_crtc *crtc, format = ALIGN(src_w * 4, 0x100); if (format > 0xffff) - return -EINVAL; + return -ERANGE; + + if (dev->chipset >= 0x30) { + if (crtc_w < (src_w >> 1) || crtc_h < (src_h >> 1)) + return -ERANGE; + } else { + if (crtc_w < (src_w >> 3) || crtc_h < (src_h >> 3)) + return -ERANGE; + } ret = nouveau_bo_pin(nv_fb->nvbo, TTM_PL_FLAG_VRAM);...
2019 Apr 24
4
[PATCH nbdkit 2/2] filters: Be careful to set *err if nbdkit_add_extent or nbdkit_extents_new fail.
This fix isn't exhaustive but it fixes some obvious problems in the filters. Rich.
2009 May 03
2
[PATCH] ocfs2: Don't print error when listing too many xattrs.
...644 --- a/fs/ocfs2/xattr.c +++ b/fs/ocfs2/xattr.c @@ -3154,7 +3154,7 @@ static int ocfs2_iterate_xattr_buckets(struct inode *inode, le32_to_cpu(bucket_xh(bucket)->xh_entries[0].xe_name_hash)); if (func) { ret = func(inode, bucket, para); - if (ret) + if (ret && ret != -ERANGE) mlog_errno(ret); /* Fall through to bucket_relse() */ } @@ -3261,7 +3261,8 @@ static int ocfs2_xattr_tree_list_index_block(struct inode *inode, ocfs2_list_xattr_bucket, &xl); if (ret) { - mlog_errno(ret); + if (ret != -ERANGE) + mlog_errno(ret); goto...
2020 Jan 06
1
[PATCH v2 2/3] drm/nouveau: Check framebuffer size against bo
...e_mode=0x%02x bw=%u bh=%u gob_size=%u bl_size=%llu size=%lu\n", > + offset, stride, h, tile_mode, bw, bh, gob_size, bl_size, > + nvbo->bo.mem.size); > + > + if (bl_size + offset > nvbo->bo.mem.size) > + return -ERANGE; > + > + return 0; > +} > + > int > nouveau_framebuffer_new(struct drm_device *dev, > const struct drm_mode_fb_cmd2 *mode_cmd, > @@ -232,6 +298,8 @@ nouveau_framebuffer_new(struct drm_device *dev, > { > struct nouveau_drm *drm =...
2020 Mar 26
9
[PATCH nbdkit 5/9 patch split 1/5] Create libnbdkit.so.
This is the previous 5/9 patch posted earlier today, split into reviewable chunks. This passes bisection with -x 'make && make check', but I didn't work very hard on the commit messages, so I refer you back to the original patch to explain how it works: https://www.redhat.com/archives/libguestfs/2020-March/msg00248.html Rich.
2017 Jul 17
2
[PATCH] drm/nouveau/hwmon: Uninitialized variables in sysfs
kstrtol() and friends can return -EINVAL or -ERANGE. We have to test for both, otherwise the value is possibly uninitialized. Also in some of these files we accidentally return "count" on error instead of a negative error code. Signed-off-by: Dan Carpenter <dan.carpenter at oracle.com> diff --git a/drivers/gpu/drm/nouveau/nouveau...
2019 Apr 24
0
[PATCH nbdkit 1/2] server: extents: Set errno on error from nbdkit_add_extent.
...erver/extents.c +++ b/server/extents.c @@ -154,6 +154,7 @@ nbdkit_add_extent (struct nbdkit_extents *exts, nbdkit_error ("nbdkit_add_extent: " "extents must be added in ascending order and " "must be contiguous"); + errno = ERANGE; return -1; } exts->next = offset + length; @@ -186,6 +187,7 @@ nbdkit_add_extent (struct nbdkit_extents *exts, nbdkit_error ("nbdkit_add_extent: " "first extent must not be > start (%" PRIu64 ")", exts-...
2013 Jan 08
0
[PATCH] avoid undefined behavior in fmt_scaled()
...led.c 2008-05-19 18:57:08.000000000 -0400 +++ openssh-6.1p1/openbsd-compat/fmt_scaled.c 2013-01-08 12:18:29.883527421 -0500 @@ -196,12 +196,16 @@ unsigned int i; unit_type unit = NONE; + /* Not every negative long long has a positive representation. */ + if (number == LLONG_MIN) { + errno = ERANGE; + return -1; + } + abval = (number < 0LL) ? -number : number; /* no long long_abs yet */ - /* Not every negative long long has a positive representation. - * Also check for numbers that are just too darned big to format - */ - if (abval < 0 || abval / 1024 >= scale_factors[SCALE_LE...
2019 Sep 23
2
[PATCH nbdkit v2] server: public: Add nbdkit_parse_* functions for safely parsing integers.
...\ + return 0 + +/* Functions for parsing signed integers. */ +int +nbdkit_parse_int (const char *what, const char *str, int *rp) +{ + long r; + char *end; + + errno = 0; + r = strtol (str, &end, 0); +#if INT_MAX != LONG_MAX + if (r < INT_MIN || r > INT_MAX) + errno = ERANGE; +#endif + PARSE_COMMON_TAIL; +} + +int +nbdkit_parse_int8_t (const char *what, const char *str, int8_t *rp) +{ + long r; + char *end; + + errno = 0; + r = strtol (str, &end, 0); + if (r < INT8_MIN || r > INT8_MAX) + errno = ERANGE; + PARSE_COMMON_TAIL; +} + +int +nbdkit_parse_i...