* [PATCH 1/1 net-next] caif_usb: remove redundant memory message
@ 2014-10-13 20:25 Fabian Frederick
2014-10-13 20:34 ` Joe Perches
0 siblings, 1 reply; 2+ messages in thread
From: Fabian Frederick @ 2014-10-13 20:25 UTC (permalink / raw)
To: linux-kernel; +Cc: Fabian Frederick, Dmitry Tarnyagin, David S. Miller, netdev
Let MM subsystem display out of memory messages.
Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
net/caif/caif_usb.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/net/caif/caif_usb.c b/net/caif/caif_usb.c
index ba02db0..0e487b0 100644
--- a/net/caif/caif_usb.c
+++ b/net/caif/caif_usb.c
@@ -87,10 +87,9 @@ static struct cflayer *cfusbl_create(int phyid, u8 ethaddr[ETH_ALEN],
{
struct cfusbl *this = kmalloc(sizeof(struct cfusbl), GFP_ATOMIC);
- if (!this) {
- pr_warn("Out of memory\n");
+ if (!this)
return NULL;
- }
+
caif_assert(offsetof(struct cfusbl, layer) == 0);
memset(this, 0, sizeof(struct cflayer));
--
1.9.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 1/1 net-next] caif_usb: remove redundant memory message
2014-10-13 20:25 [PATCH 1/1 net-next] caif_usb: remove redundant memory message Fabian Frederick
@ 2014-10-13 20:34 ` Joe Perches
0 siblings, 0 replies; 2+ messages in thread
From: Joe Perches @ 2014-10-13 20:34 UTC (permalink / raw)
To: Fabian Frederick; +Cc: linux-kernel, Dmitry Tarnyagin, David S. Miller, netdev
On Mon, 2014-10-13 at 22:25 +0200, Fabian Frederick wrote:
> Let MM subsystem display out of memory messages.
[]
> diff --git a/net/caif/caif_usb.c b/net/caif/caif_usb.c
[]
> @@ -87,10 +87,9 @@ static struct cflayer *cfusbl_create(int phyid, u8 ethaddr[ETH_ALEN],
> {
> struct cfusbl *this = kmalloc(sizeof(struct cfusbl), GFP_ATOMIC);
>
> - if (!this) {
> - pr_warn("Out of memory\n");
> + if (!this)
> return NULL;
> - }
> +
> caif_assert(offsetof(struct cfusbl, layer) == 0);
>
> memset(this, 0, sizeof(struct cflayer));
This bit should probably be:
memset(&this->layer, 0, sizeof(this->layer));
or the allocation above should use kzalloc.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-10-13 20:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-13 20:25 [PATCH 1/1 net-next] caif_usb: remove redundant memory message Fabian Frederick
2014-10-13 20:34 ` Joe Perches
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).