list_del(&ip->list);
}
-static struct img_ip *find_img_ip(struct img_file *file, unsigned long addr)
+static struct img_ip *find_img_ip(struct img_file *file, unsigned long addr,
+ struct probe_desc *pd)
{
struct img_ip *ip;
list_for_each_entry(ip, &file->ip_list, list) {
- if (ip->addr == addr)
+ if ((ip->addr == addr) &&
+ (ip->desc == pd))
return ip;
}
* @return Error code
*/
int img_file_add_ip(struct img_file *file, unsigned long addr,
- struct probe_info *probe_i)
+ struct probe_desc *pd)
{
struct img_ip *ip;
- ip = find_img_ip(file, addr);
+ ip = find_img_ip(file, addr, pd);
if (ip) {
/* ip already exists in img */
return 0;
}
- ip = create_img_ip(addr, probe_i);
+ ip = create_img_ip(addr, pd);
if (ip == NULL)
return -ENOMEM;
-
img_add_ip_by_list(file, ip);
return 0;
* @param addr Function address
* @return Error code
*/
-int img_file_del_ip(struct img_file *file, unsigned long addr)
+int img_file_del_ip(struct img_file *file, unsigned long addr,
+ struct probe_desc *pd)
{
struct img_ip *ip;
- ip = find_img_ip(file, addr);
+ ip = find_img_ip(file, addr, pd);
if (ip == NULL) {
printk(KERN_INFO "Warning: no ip found in img, addr = %lx\n",
addr);
}
img_del_ip_by_list(ip);
+ free_img_ip(ip);
return 0;
}