Re: [U-Boot] [PATCH] LZMA: Avoid free on null pointer.

2010-12-06 Thread Wolfgang Denk
Dear Luigi Mantellini, In message you wrote: > > my pov is different: free should (must) be called only on already > allocated pointers. I know that free code checks at begin if ptr is > null or not. Anyway I don't understand why a null pointer check before > to call free cannot be added to the

Re: [U-Boot] [PATCH] LZMA: Avoid free on null pointer.

2010-12-06 Thread Joakim Tjernlund
Luigi Mantellini wrote on 2010/12/06 10:47:21: > > Hi Joakim, > > We have not "ton" but just two points to fix. 1) when free dict before > to allocate another one, and 2) when free probs before to allocate > another one. These scenarios are not used into u-boot code, because > the library is "one

Re: [U-Boot] [PATCH] LZMA: Avoid free on null pointer.

2010-12-06 Thread Luigi Mantellini
Hi Joakim, We have not "ton" but just two points to fix. 1) when free dict before to allocate another one, and 2) when free probs before to allocate another one. These scenarios are not used into u-boot code, because the library is "one shot" and the other free are called (if called) just to deall

Re: [U-Boot] [PATCH] LZMA: Avoid free on null pointer.

2010-12-06 Thread Joakim Tjernlund
> > On Mon, Dec 6, 2010 at 9:57 AM, Mike Frysinger wrote: > > > > sorry, but this is not an acceptable reason.  so unless you have an actual > > error report here, your patch gets NAK-ed. > > -mike > > > > Hi mike, > > my pov is different: free should (must) be called only on already > allocated p

Re: [U-Boot] [PATCH] LZMA: Avoid free on null pointer.

2010-12-06 Thread Luigi Mantellini
On Mon, Dec 6, 2010 at 9:57 AM, Mike Frysinger wrote: > > sorry, but this is not an acceptable reason.  so unless you have an actual > error report here, your patch gets NAK-ed. > -mike > Hi mike, my pov is different: free should (must) be called only on already allocated pointers. I know that f

Re: [U-Boot] [PATCH] LZMA: Avoid free on null pointer.

2010-12-06 Thread Mike Frysinger
On Monday, December 06, 2010 03:59:44 Luigi Mantellini wrote: > On Mon, Dec 6, 2010 at 8:15 AM, Mike Frysinger wrote: > > On Sunday, December 05, 2010 04:18:44 Luigi 'Comio' Mantellini wrote: > >> On structure Initialization, LZMA code tries to free the dictionary > >> and probs buffers, also when

Re: [U-Boot] [PATCH] LZMA: Avoid free on null pointer.

2010-12-06 Thread Luigi Mantellini
On Mon, Dec 6, 2010 at 8:15 AM, Mike Frysinger wrote: > On Sunday, December 05, 2010 04:18:44 Luigi 'Comio' Mantellini wrote: >> On structure Initialization, LZMA code tries to free the dictionary >> and probs buffers, also when these are null pointers. Add some >> check in order to prevent the fr

Re: [U-Boot] [PATCH] LZMA: Avoid free on null pointer.

2010-12-05 Thread Mike Frysinger
On Sunday, December 05, 2010 04:18:44 Luigi 'Comio' Mantellini wrote: > On structure Initialization, LZMA code tries to free the dictionary > and probs buffers, also when these are null pointers. Add some > check in order to prevent the free on null pointers. your patch only checks p->probs, not a

Re: [U-Boot] [PATCH] LZMA: Avoid free on null pointer.

2010-12-05 Thread Joakim Tjernlund
Luigi Mantellini wrote on 2010/12/05 11:19:58: > On Sun, Dec 5, 2010 at 11:12 AM, Joakim Tjernlund > wrote: > >> > >> On structure Initialization, LZMA code tries to free the dictionary > >> and probs buffers, also when these are null pointers. Add some > >> check in order to prevent the free on

Re: [U-Boot] [PATCH] LZMA: Avoid free on null pointer.

2010-12-05 Thread Luigi Mantellini
On Sun, Dec 5, 2010 at 11:12 AM, Joakim Tjernlund wrote: >> >> On structure Initialization, LZMA code tries to free the dictionary >> and probs buffers, also when these are null pointers. Add some >> check in order to prevent the free on null pointers. >> >> Signed-off-by: Luigi 'Comio' Mantellini

Re: [U-Boot] [PATCH] LZMA: Avoid free on null pointer.

2010-12-05 Thread Joakim Tjernlund
> > On structure Initialization, LZMA code tries to free the dictionary > and probs buffers, also when these are null pointers. Add some > check in order to prevent the free on null pointers. > > Signed-off-by: Luigi 'Comio' Mantellini Why not move these NULL checks inside LzmaDec_FreeProbs? Then