Change-Id: Ic852d3d40b4b0dcb0dfa5f867aa3f02d3647aa03
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
alloc_nodes = COMMON_URP_NR;
for (i = 0; i < alloc_nodes; ++i) {
- inst = kmalloc(sizeof(*inst), GFP_ATOMIC);
+ inst = kmalloc(sizeof(*inst) + rp->data_size, GFP_ATOMIC);
if (inst == NULL) {
free_urp_inst(rp);
return -ENOMEM;
INIT_HLIST_HEAD(&rp->free_instances);
for (i = 0; i < rp->maxactive; i++) {
- inst = kmalloc(sizeof(*inst), GFP_ATOMIC);
+ inst = kmalloc(sizeof(*inst) + rp->data_size, GFP_ATOMIC);
if (inst == NULL) {
free_urp_inst(rp);
return -ENOMEM;
/** Tracks the number of times the probed function's return was
* ignored, due to maxactive being too low. */
int nmissed;
+ size_t data_size; /**< Instance data size */
struct hlist_head free_instances; /**< Free instances list */
struct hlist_head used_instances; /**< Used instances list */
kprobe_opcode_t *ret_addr; /**< Return address */
kprobe_opcode_t *sp; /**< Pointer to stack */
struct task_struct *task; /**< Pointer to the task struct */
+ char data[0]; /**< Custom data */
};
int swap_register_uprobe(struct uprobe *p);