dev_id =  pnpbios_kmalloc(sizeof (struct pnp_id), GFP_KERNEL); 
dev_id =  kcalloc(1, sizeof (struct pnp_id), GFP_KERNEL); 
pnpbios_parse_compatible_ids(unsigned char *p, unsigned char *end, struct pnp_dev *dev){	int len, tag;	char id[8];	struct pnp_id *dev_id;	if (!p)		return NULL;	while ((char *)p < (char *)end) {		/* determine the type of tag */		if (p[0] & LARGE_TAG) { /* large tag */			len = (p[2] << 8) | p[1];			tag = p[0];		} else { /* small tag */			len = p[0] & 0x07;			tag = ((p[0]>>3) & 0x0f);		}		switch (tag) {		case LARGE_TAG_ANSISTR:			strncpy(dev->name, p + 3, len >= PNP_NAME_LEN ? PNP_NAME_LEN - 2 : len);			dev->name[len >= PNP_NAME_LEN ? PNP_NAME_LEN - 1 : len] = '\0';			break;		case SMALL_TAG_COMPATDEVID: /* compatible ID */			if (len != 4)				goto len_err;			dev_id =  pnpbios_kmalloc(sizeof (struct pnp_id), GFP_KERNEL);			if (!dev_id)				return NULL;			memset(dev_id, 0, sizeof(struct pnp_id));			pnpid32_to_pnpid(p[1] | p[2] << 8 | p[3] << 16 | p[4] << 24,id);			memcpy(&dev_id->id, id, 7);			pnp_add_id(dev_id, dev);			break;		case SMALL_TAG_END:			p = p + 2;        		return (unsigned char *)p;			break;		default: /* an unkown tag */			len_err:			printk(KERN_ERR "PnPBIOS: Unknown tag '0x%x', length '%d'.\n", tag, len);			break;		}		/* continue to the next tag */		if (p[0] & LARGE_TAG)			p += len + 3;		else			p += len + 1;	}	printk(KERN_ERR "PnPBIOS: Resource structure does not contain an end tag.\n");	return NULL;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/a2822e7f00cdccbff8e507b5ebbddce1aa95eb5d/rsparser.c/buggy/drivers/pnp/pnpbios/rsparser.c