if (copy_from_user(p_ca_message, arg, sizeof (struct ca_msg))) return -EFAULT; 
if (copy_from_user(p_ca_message, (void *)arg, sizeof (struct ca_msg))) { result = -EFAULT; goto free_mem_and_exit; }  
static int ca_send_message(struct dst_state *state, struct ca_msg *p_ca_message, void __user *arg){	int i = 0;	unsigned int ca_message_header_len;	u32 command = 0;	struct ca_msg *hw_buffer;	if ((hw_buffer = (struct ca_msg *) kmalloc(sizeof (struct ca_msg), GFP_KERNEL)) == NULL) {		dprintk(verbose, DST_CA_ERROR, 1, " Memory allocation failure");		return -ENOMEM;	}	dprintk(verbose, DST_CA_DEBUG, 1, " ");	if (copy_from_user(p_ca_message, arg, sizeof (struct ca_msg)))		return -EFAULT;	if (p_ca_message->msg) {		ca_message_header_len = p_ca_message->length;	/*	Restore it back when you are done	*/		/*	EN50221 tag	*/		command = 0;		for (i = 0; i < 3; i++) {			command = command | p_ca_message->msg[i];			if (i < 2)				command = command << 8;		}		dprintk(verbose, DST_CA_DEBUG, 1, " Command=[0x%x]\n", command);		switch (command) {		case CA_PMT:			dprintk(verbose, DST_CA_DEBUG, 1, "Command = SEND_CA_PMT");			if ((ca_set_pmt(state, p_ca_message, hw_buffer, 0, 0)) < 0) {	// code simplification started				dprintk(verbose, DST_CA_ERROR, 1, " -->CA_PMT Failed !");				return -1;			}			dprintk(verbose, DST_CA_INFO, 1, " -->CA_PMT Success !");			break;		case CA_PMT_REPLY:			dprintk(verbose, DST_CA_INFO, 1, "Command = CA_PMT_REPLY");			/*      Have to handle the 2 basic types of cards here  */			if ((dst_check_ca_pmt(state, p_ca_message, hw_buffer)) < 0) {				dprintk(verbose, DST_CA_ERROR, 1, " -->CA_PMT_REPLY Failed !");				return -1;			}			dprintk(verbose, DST_CA_INFO, 1, " -->CA_PMT_REPLY Success !");			break;		case CA_APP_INFO_ENQUIRY:		// only for debugging			dprintk(verbose, DST_CA_INFO, 1, " Getting Cam Application information");			if ((ca_get_app_info(state)) < 0) {				dprintk(verbose, DST_CA_ERROR, 1, " -->CA_APP_INFO_ENQUIRY Failed !");				return -1;			}			dprintk(verbose, DST_CA_INFO, 1, " -->CA_APP_INFO_ENQUIRY Success !");			break;		}	}	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/f630558dfbd47301c2ce30f7e4acd2817a7455ac/dst_ca.c/buggy/drivers/media/dvb/bt8xx/dst_ca.c