calloc: Fix possible memory leak
Subsystems (3)
PATCH 1/3 calloc: Fix possible memory leak
Signed-off-by Alexander Shiyan <[email protected]>
--- common/dlmalloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
common/dlmalloc.c +2 -2
@@ -1750,11 +1750,11 @@ void *calloc(size_t n, size_t elem_size)mchunkptr oldtop = top;INTERNAL_SIZE_T oldtopsize =chunksize (top); -void *mem =malloc (sz); -if ((long )n <0 )return NULL ; +void *mem =malloc (sz); +if (!mem)return NULL ;else {
Signature · 7 lines
1.8.1.5 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 2/3 gadget: at91: Fix uninitialized variable
Variable udc is used unitialized for DBG(xxx).
Signed-off-by Alexander Shiyan <[email protected]>
--- drivers/usb/gadget/at91_udc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/gadget/at91_udc.c +2 -2
@@ -414,6 +414,8 @@ static int at91_ep_queue(struct usb_ep *_ep, req = container_of(_req, struct at91_request, req); ep = container_of(_ep, struct at91_ep, ep); + udc = ep->udc; +if (!_req || !_req->complete || !_req->buf || !list_empty (&req->queue)) {DBG (udc,"invalid request\n" );
@@ -425,8 +427,6 @@ static int at91_ep_queue(struct usb_ep *_ep,return -EINVAL ; } - udc = ep->udc; -if (!udc || !udc->driver || udc->gadget.speed ==USB_SPEED_UNKNOWN ) {DBG (udc,"invalid device\n" );return -EINVAL ;
Signature · 7 lines
1.8.1.5 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 3/3 ubifs: Remove redundant assignment
In reply to Alexander ShiyanSigned-off-by Alexander Shiyan <[email protected]>
--- fs/ubifs/recovery.c | 1 - fs/ubifs/scan.c | 1 - 2 files changed, 2 deletions(-)
fs/ubifs/recovery.c +0 -1
@@ -392,7 +392,6 @@ static void clean_buf(const struct ubifs_info *c, void **buf, int lnum, {int empty_offs, pad_len; - lnum = lnum;dbg_rcvry ("cleaning corruption at %d:%d" , lnum, *offs);if (c->min_io_size ==1 ) {
fs/ubifs/scan.c +0 -1
@@ -175,7 +175,6 @@ struct ubifs_scan_leb *ubifs_start_scan(const struct ubifs_info *c, int lnum,void ubifs_end_scan (const struct ubifs_info *c,struct ubifs_scan_leb *sleb,int lnum,int offs) { - lnum = lnum;dbg_scan ("stop scanning LEB %d at offset %d" , lnum, offs);ubifs_assert (offs % c->min_io_size ==0 );
Signature · 7 lines
1.8.1.5 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Sascha Hauer
AppliedQuoted 2 lines · Alexander Shiyan
Signed-off-by Alexander Shiyan <[email protected]>
Applied all, thanks
Sascha
Quoted 31 lines
--- common/dlmalloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)common/dlmalloc.c +2
-2@@ -1750,11 +1750,11 @@ void *calloc(size_t n, size_t elem_size)mchunkptr oldtop = top;INTERNAL_SIZE_T oldtopsize =chunksize (top); -void *mem =malloc (sz); -if ((long )n <0 )return NULL ; +void *mem =malloc (sz); +if (!mem)return NULL ;else {Signature · 7 lines
1.8.1.5 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Signature · 9 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox