search for: outlen

Displaying 20 results from an estimated 67 matches for "outlen".

Did you mean: out_len
2019 Nov 06
0
【SPEEX】 use speex resample make noise
...mp;err); >     FILE *fp = fopen("/data/zhou.wav", "rb+"); >     FILE *fp2 = fopen("/data/zhou2.wav", "ab+"); >     spx_int16_t inbuff[640] = {0}; >     spx_int16_t outbuff[1920] = {0}; >     spx_uint32_t inlen = 640; >     spx_uint32_t outlen = 1920; >     while (1) >     { >         speex_resampler_reset_mem(speex_resampler); >         int len = fread(inbuff, 2, 320, fp); >         if (len <= 0) >         { >             break; >         } >         int ret = speex_resampler_process_int(speex_resa...
2020 Aug 06
1
[PATCH][next] vdpa/mlx5: fix memory allocation failure checks
...it a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/mlx5_vnet.c index 3ec44a4f0e45..55bc58e1dae9 100644 --- a/drivers/vdpa/mlx5/net/mlx5_vnet.c +++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c @@ -867,7 +867,7 @@ static void alloc_inout(struct mlx5_vdpa_net *ndev, int cmd, void **in, int *inl *outlen = MLX5_ST_SZ_BYTES(qp_2rst_out); *in = kzalloc(*inlen, GFP_KERNEL); *out = kzalloc(*outlen, GFP_KERNEL); - if (!in || !out) + if (!*in || !*out) goto outerr; MLX5_SET(qp_2rst_in, *in, opcode, cmd); @@ -879,7 +879,7 @@ static void alloc_inout(struct mlx5_vdpa_net *ndev, int cmd, voi...
2018 Feb 28
0
[PATCH v3 1/2] common: extract UTF-8 conversion function
...s_int_parse_nonstandard_uri (const char *arg) return ret; } - -/* Would be const, but the interface to iconv is not const-correct on - * all platforms. The input string is not touched. - */ -static char * -local_string_to_utf8 (/* const */ char *input) -{ - iconv_t ic; - size_t len, inlen, outlen, outalloc, r, prev; - int err; - char *out, *inp, *outp; - - /* Convert from input locale to UTF-8. */ - ic = iconv_open ("UTF-8", nl_langinfo (CODESET)); - if (ic == (iconv_t) -1) - return NULL; - - len = strlen (input); - outalloc = len; /* Initial guess. */ - -...
2019 Nov 05
0
【SPEEX】 use speex resample make noise
...mp;err); >     FILE *fp = fopen("/data/zhou.wav", "rb+"); >     FILE *fp2 = fopen("/data/zhou2.wav", "ab+"); >     spx_int16_t inbuff[640] = {0}; >     spx_int16_t outbuff[1920] = {0}; >     spx_uint32_t inlen = 640; >     spx_uint32_t outlen = 1920; >     speex_resampler_skip_zeros(speex_resampler); >     while (1) >     { >         int len = fread(inbuff, 2, 320, fp); >         if (len <= 0) >         { >             break; >         } >         int ret = speex_resampler_process_int(speex_resampl...
2020 Aug 07
1
[PATCH] vdpa/mlx5: Fix erroneous null pointer checks
.../mlx5_vnet.c b/drivers/vdpa/mlx5/net/mlx5_vnet.c > index 3ec44a4f0e45..bcb6600c2839 100644 > --- a/drivers/vdpa/mlx5/net/mlx5_vnet.c > +++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c > @@ -867,7 +867,7 @@ static void alloc_inout(struct mlx5_vdpa_net *ndev, int cmd, void **in, int *inl > *outlen = MLX5_ST_SZ_BYTES(qp_2rst_out); > *in = kzalloc(*inlen, GFP_KERNEL); > *out = kzalloc(*outlen, GFP_KERNEL); > - if (!in || !out) > + if (!*in || !*out) > goto outerr; > > MLX5_SET(qp_2rst_in, *in, opcode, cmd); > @@ -879,7 +879,7 @@ static void alloc_i...
2013 Jun 19
3
[PATCH] virtio-spec: add field for scsi command size
Il 19/06/2013 10:24, Michael S. Tsirkin ha scritto: >> > 2) We introduce VIRTIO_NET_F_ANY_LAYOUT and VIRTIO_BLK_F_ANY_LAYOUT >> > specifically for net and block (note the new names). So why not a transport feature? Is it just because the SCSI commands for virtio-blk also require a config space field? Sorry if I missed this upthread. Paolo >> > 3) I note the
2013 Jun 19
3
[PATCH] virtio-spec: add field for scsi command size
Il 19/06/2013 10:24, Michael S. Tsirkin ha scritto: >> > 2) We introduce VIRTIO_NET_F_ANY_LAYOUT and VIRTIO_BLK_F_ANY_LAYOUT >> > specifically for net and block (note the new names). So why not a transport feature? Is it just because the SCSI commands for virtio-blk also require a config space field? Sorry if I missed this upthread. Paolo >> > 3) I note the
2010 Jul 22
0
Fwd: [PATCH hivex] non-ASCII characters in node names
...nv_t ic = iconv_open ("UTF-8", "UTF-16"); - if (ic == (iconv_t) -1) - return NULL; - - /* iconv(3) has an insane interface ... */ - - /* Mostly UTF-8 will be smaller, so this is a good initial guess. */ size_t outalloc = len; - - again:; - size_t inlen = len; - size_t outlen = outalloc; - char *out = malloc (outlen + 1); - if (out == NULL) { - int err = errno; - iconv_close (ic); - errno = err; - return NULL; - } - char *inp = input; - char *outp = out; - - size_t r = iconv (ic, &inp, &inlen, &outp, &outlen); - if (r == (size_t) -1) {...
2013 Jun 20
0
[PATCH] virtio-spec: add field for scsi command size
...!d.length) { + BUG_ON(dnum == 0); + dst++; + dnum--; + d = *dst; + } + } +} + +static bool torture_replace(struct scatterlist **sg, + unsigned int *out, + unsigned int *in, + void **data, + gfp_t gfp) +{ + static size_t seed; + struct torture *t; + unsigned long outlen, inlen, ourseed, len1; + void *buf; + + if (!device_torture) + return true; + + outlen = tot_len(*sg, *out); + inlen = tot_len(*sg + *out, *in); + + /* This will break horribly on large block requests. */ + t = kmalloc(sizeof(*t) + (*out + *in) * sizeof(t->orig_sg[1]) + + outlen + 1 + inle...
2018 Feb 28
2
[PATCH v3 0/2] inspect: basic UTF-8 encoding for rpm
Diff to v2: * inlined local_string_to_utf8 Cédric Bosdonnat (2): common: extract UTF-8 conversion function inspector: rpm summary and description may not be utf-8 common/utils/guestfs-utils.h | 11 +++++ common/utils/libxml2-utils.c | 69 +-------------------------- common/utils/utils.c | 64 +++++++++++++++++++++++++
2014 Jan 06
1
Re: [PATCH 2/2] lib: utf16: Fix const-correctness issues in _hivex_recode function.
...1,10 +51,11 @@ _hivex_recode (char *input_encoding, const char > *input, size_t input_len, errno = err; > return NULL; > } > - char *inp = input; > + const char *inp = input; > char *outp = out; > > - size_t r = iconv (ic, &inp, &inlen, &outp, &outlen); > + /* Surely iconv doesn't really modify the input buffer? XXX */ > + size_t r = iconv (ic, (char **) &inp, &inlen, &outp, &outlen); > if (r == (size_t) -1) { This (the constness of the input argument) is the difference between the iconv implementation provide...
2013 Dec 31
2
[PATCH 1/2] lib: write: Remove unused variable.
--- lib/write.c | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/write.c b/lib/write.c index 8c4dd8e..384c6b2 100644 --- a/lib/write.c +++ b/lib/write.c @@ -954,7 +954,6 @@ hivex_node_set_values (hive_h *h, hive_node_h node, for (i = 0; i < nr_values; ++i) { /* Allocate vk record to store this (key, value) pair. */ static const char vk_id[2] = { 'v', 'k' }; -
2013 Jun 20
3
[PATCH] virtio-spec: add field for scsi command size
...= *dst; > + } > + } > +} > + > +static bool torture_replace(struct scatterlist **sg, > + unsigned int *out, > + unsigned int *in, > + void **data, > + gfp_t gfp) > +{ > + static size_t seed; > + struct torture *t; > + unsigned long outlen, inlen, ourseed, len1; > + void *buf; > + > + if (!device_torture) > + return true; > + > + outlen = tot_len(*sg, *out); > + inlen = tot_len(*sg + *out, *in); > + > + /* This will break horribly on large block requests. */ > + t = kmalloc(sizeof(*t) + (*out + *in) * s...
2013 Jun 20
3
[PATCH] virtio-spec: add field for scsi command size
...= *dst; > + } > + } > +} > + > +static bool torture_replace(struct scatterlist **sg, > + unsigned int *out, > + unsigned int *in, > + void **data, > + gfp_t gfp) > +{ > + static size_t seed; > + struct torture *t; > + unsigned long outlen, inlen, ourseed, len1; > + void *buf; > + > + if (!device_torture) > + return true; > + > + outlen = tot_len(*sg, *out); > + inlen = tot_len(*sg + *out, *in); > + > + /* This will break horribly on large block requests. */ > + t = kmalloc(sizeof(*t) + (*out + *in) * s...
2007 Apr 10
1
[PATCH] Add support for DHCP-Options
...+ const char test[] = "UNKNOWN"; + + if (len >= 5 && memcmp(str, "dhcp/", 5) == 0) { + out = getvar_dhcp(str+5, len-5); + } + + if (out == NULL) { + out = malloc(sizeof(test)); + strcpy(out, test); + } + + return out; +} + +void append_output(char **out, size_t *outlen, const char *str, size_t len) +{ + size_t used; + + used = (*out != NULL) ? strlen(*out) : 0; + if (used + len + 1 > *outlen) { + *outlen += 256 + (len & ~255); + *out = realloc(*out, *outlen); + } + memcpy(*out + used, str, len); + (*out)[used+len] = '\0'; +} + +char *do_subst(co...
2018 Feb 15
3
[PATCH v2 0/2] inspect: basic UTF-8 encoding for rpm
This needs Richard's patch: https://www.redhat.com/archives/libguestfs/2018-February/msg00099.html Diff to v1: * factorized the UTF-8 conversion functions * small style fixes Cédric Bosdonnat (2): common: extract UTF-8 conversion function inspector: rpm summary and description may not be utf-8 common/utils/guestfs-utils.h | 1 + common/utils/libxml2-utils.c
2012 Sep 28
6
[PATCH 0/3] virtio-net: inline header support
Thinking about Sasha's patches, we can reduce ring usage for virtio net small packets dramatically if we put virtio net header inline with the data. This can be done for free in case guest net stack allocated extra head room for the packet, and I don't see why would this have any downsides. Even though with my recent patches qemu no longer requires header to be the first s/g element, we
2012 Sep 28
6
[PATCH 0/3] virtio-net: inline header support
Thinking about Sasha's patches, we can reduce ring usage for virtio net small packets dramatically if we put virtio net header inline with the data. This can be done for free in case guest net stack allocated extra head room for the packet, and I don't see why would this have any downsides. Even though with my recent patches qemu no longer requires header to be the first s/g element, we
2018 Feb 09
3
[PATCH] Add a cache for iconv_t handles to hive_t
...t *output_len) { - iconv_t ic = iconv_open (output_encoding, input_encoding); - if (ic == (iconv_t) -1) - return NULL; - /* iconv(3) has an insane interface ... */ size_t outalloc = input_len; + iconv_t *ic = _hivex_get_iconv (h, t); again:; size_t inlen = input_len; size_t outlen = outalloc; char *out = malloc (outlen + 1); if (out == NULL) { int err = errno; - iconv_close (ic); + _hivex_release_iconv (h, t); errno = err; return NULL; } @@ -56,18 +53,17 @@ _hivex_recode (const char *input_encoding, const char *input, size_t input_len, size...
2004 Jan 01
1
[PATCH] Add winbind-backed NTLMSSP support to Cyrus-SASL
...} - - UINT16_TO_INTEL(len, buf->len); - buf->maxlen = buf->len; - UINT32_TO_INTEL(*offset, buf->offset); - *offset += len; -} - -/* unload a string from an NTLM buffer */ -static int unload_buffer(const sasl_utils_t *utils, ntlm_buffer_t *buf, - u_char **str, unsigned *outlen, - int unicode, u_char *base, unsigned msglen) -{ - uint16 len = 0; - - UINT16_FROM_INTEL(buf->len, len); - if (len) { - uint32 offset = 0; + context->child_pid = fork(); - *str = utils->malloc(len + 1); /* add 1 for NUL */ - if (*str == NULL) { - MEMERROR(utils); -...