From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from fmmailgate01.web.de ([217.72.192.221]) by canuck.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1PUy3b-0002LN-Fz for barebox@lists.infradead.org; Tue, 21 Dec 2010 08:58:56 +0000 Date: Tue, 21 Dec 2010 09:58:53 +0100 From: Sascha Hauer Message-ID: <20101221085853.GW6017@pengutronix.de> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: barebox-bounces@lists.infradead.org Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: Re: [PATCH 5] Fix error handling with malloc, memalign etc. Memalign() can't fail now. To: Krzysztof Halasa Cc: barebox@lists.infradead.org T24gTW9uLCBEZWMgMjAsIDIwMTAgYXQgMTE6NTQ6NDlQTSArMDEwMCwgS3J6eXN6dG9mIEhhbGFz YSB3cm90ZToKPiBGaXggZXJyb3IgaGFuZGxpbmcgd2l0aCBtYWxsb2MsIG1lbWFsaWduIGV0Yy4g TWVtYWxpZ24oKSBjYW4ndCBmYWlsIG5vdy4KPiAKPiBUaGUgaWRlYSBpcyB0byBwYW5pYygpIHdo ZW4gdGhlcmUgaXMgbm8gbWVtb3J5IGF2YWlsYWJsZSBmb3Igbm9ybWFsCj4gb3BlcmF0aW9uLiBF eGNlcHRpb246IGNvZGUgd2hpY2ggY2FuIGNvbnN1bWUgYXJiaXRyYXJ5IGFtb3VudCBvZiBSQU0K PiAoZXhhbXBsZTogZmlsZXMgYWxsb2NhdGVkIGluIHJhbWZzKSBtdXN0IHJlcG9ydCBlcnJvciBp bnN0ZWFkIG9mCj4gcGFuaWMoKS4KPiAKPiBUaGlzIHBhdGNoIGFsc28gZml4ZXMgY29kZSB3aGlj aCBkaWRuJ3QgY2hlY2sgZm9yIE5VTEwgZnJvbSBtYWxsb2MoK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uIFRoZSB4IGluIHRoZSBuYW1lIHN0cmVzc2VzIHRoYXQgdGhlIHJldHVybiB2 YWx1ZSBkb2Vzbid0IGhhdmUKdG8gYmUgY2hlY2tlZC4gQWxzbyBpdCBnaXZlcyB0aGUgdXNlciBh IGNoYW5jZSBleHBsaWNpdGVseSBjYWxsIG1lbWFsaWduCmlmIGhlIHdpc2hlcyB0by4KClNhc2No YQoKLS0gClBlbmd1dHJvbml4IGUuSy4gICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAg ICAgICAgICAgICAgICAgICAgICAgICB8CkluZHVzdHJpYWwgTGludXggU29sdXRpb25zICAgICAg ICAgICAgICAgICB8IGh0dHA6Ly93d3cucGVuZ3V0cm9uaXguZGUvICB8ClBlaW5lciBTdHIuIDYt OCwgMzExMzcgSGlsZGVzaGVpbSwgR2VybWFueSB8IFBob25lOiArNDktNTEyMS0yMDY5MTctMCAg ICB8CkFtdHNnZXJpY2h0IEhpbGRlc2hlaW0sIEhSQSAyNjg2ICAgICAgICAgICB8IEZheDogICAr NDktNTEyMS0yMDY5MTctNTU1NSB8CgpfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fXwpiYXJlYm94IG1haWxpbmcgbGlzdApiYXJlYm94QGxpc3RzLmluZnJhZGVh ZC5vcmcKaHR0cDovL2xpc3RzLmluZnJhZGVhZC5vcmcvbWFpbG1hbi9saXN0aW5mby9iYXJlYm94 Cg==