fd = open (can_path, O_RDWR);
if (fd == -1) {
FRESCAN_ERROR ("could not open /dev/can%u\n", params->net);
+ FRESCAN_ERROR ("hint: check driver or card installation\n");
return -1;
}
DEBUG(FRESCAN_RX_HOOK_ENABLE_DEBUG || FRESCAN_FRAG_ENABLE_DEBUG,
"prio:%u dest:%u src:%u chan:%u id:%u flag:%u\n",
prio, dest, src, channel, frag_id, frag_flag);
-
DEBUG(FRESCAN_RX_HOOK_ENABLE_DEBUG,
"enqueue the packet in ID queue\n");
+
packet = frescan_packets_alloc();
+ if (packet == NULL) {
+ FRESCAN_ERROR("could not allocate packet\n");
+ return -1;
+ }
+
packet->frame = frame;
if (frag_id == FRESCAN_MX_IDS) {
FRESCAN_FRAG_ENABLE_DEBUG,
"allocate head for id=%u\n", frag_id);
head = frescan_packets_alloc();
+ if (head == NULL) {
+ FRESCAN_ERROR("could not allocate packet\n");
+ return -1;
+ }
+
INIT_LIST_HEAD(&head->msg_list);
if (frag_id == FRESCAN_MX_IDS) {