Revision 4e880168e9ffb1cdbdb72b3b48ab0324b30c2d62 authored by Dan Carpenter on 08 June 2017, 13:47:49 UTC, committed by James Morris on 09 June 2017, 03:29:45 UTC
We forgot to set the error code on this path so it could result in
returning NULL which leads to a NULL dereference.

Fixes: db6c43bd2132 ("crypto: KEYS: convert public key and digsig asym to the akcipher api")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: James Morris <james.l.morris@oracle.com>
1 parent 381f20f
Raw File
psample.h
#ifndef __NET_PSAMPLE_H
#define __NET_PSAMPLE_H

#include <uapi/linux/psample.h>
#include <linux/module.h>
#include <linux/list.h>

struct psample_group {
	struct list_head list;
	struct net *net;
	u32 group_num;
	u32 refcount;
	u32 seq;
};

struct psample_group *psample_group_get(struct net *net, u32 group_num);
void psample_group_put(struct psample_group *group);

#if IS_ENABLED(CONFIG_PSAMPLE)

void psample_sample_packet(struct psample_group *group, struct sk_buff *skb,
			   u32 trunc_size, int in_ifindex, int out_ifindex,
			   u32 sample_rate);

#else

static inline void psample_sample_packet(struct psample_group *group,
					 struct sk_buff *skb, u32 trunc_size,
					 int in_ifindex, int out_ifindex,
					 u32 sample_rate)
{
}

#endif

#endif /* __NET_PSAMPLE_H */
back to top