From owner-freebsd-current@FreeBSD.ORG Thu Feb 18 08:15:52 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A53AC106568D for ; Thu, 18 Feb 2010 08:15:52 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe02.swip.net [212.247.154.33]) by mx1.freebsd.org (Postfix) with ESMTP id 3A2878FC16 for ; Thu, 18 Feb 2010 08:15:51 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=uJWmglzsLAgA:10 a=MnI1ikcADjEx7bvsp0jZvQ==:17 a=Lt-vM3cS9r3j_m2B2ZsA:9 a=QVwPP2qhbwkKGmkBQAkA:7 a=WH2IVQCPx0Yf-ViAe2sj3LIXWqsA:4 Received: from [188.126.201.140] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe02.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 1354030566 for freebsd-current@freebsd.org; Thu, 18 Feb 2010 09:15:49 +0100 To: freebsd-current@freebsd.org From: Hans Petter Selasky X-Face: +~\`s("[*|O,="7?X@L.elg*F"OA\I/3%^p8g?ab%RN'( =?iso-8859-15?q?=3B=5FIjlA=3A=0A=09hGE=2E=2EEw?=, =?iso-8859-15?q?XAQ*o=23=5C/M=7ESC=3DS1-f9=7BEzRfT=27=7CHhll5Q=5Dha5Bt-s=7Co?= =?iso-8859-15?q?TlKMusi=3A1e=5BwJl=7Dkd=7DGR=0A=09Z0adGx-x=5F0zGbZj=27e?=(Y[(UNle~)8CQWXW@:DX+9)_YlB[tIccCPN$7/L' Date: Thu, 18 Feb 2010 09:14:20 +0100 MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201002180914.20287.hselasky@c2i.net> Subject: Re: FYI: v4l-linuxulator support in FreeBSD-current now [panic] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2010 08:15:52 -0000 On Tuesday 12 January 2010 18:49:48 Hans Petter Selasky wrote: > Re: FYI: v4l-linuxulator support in FreeBSD-current now > Hi, Some panics have cropped up when using linux-V4L with webcamd. 1st) panic: freeing memory in linux_v4l_cliplist_free() which is not allocated, but there seems to be more which needs to be done. I tried to fix something, but it was apparently not enough. Help appreciated. One question: Do we need to handle the IOCTL's in question at all in the linuxulator? --HPS --- linux_ioctl.c.orig 2010-02-17 20:42:53.000000000 +0100 +++ linux_ioctl.c 2010-02-17 21:03:10.000000000 +0100 @@ -2711,7 +2711,7 @@ /* XXX: If there can be no concurrency: s/M_NOWAIT/M_WAITOK/ */ if ((*ppvc = malloc(sizeof(**ppvc), M_LINUX, M_NOWAIT)) == NULL) return (ENOMEM); /* XXX: linux has no ENOMEM here */ - memcpy(&vclip, *ppvc, sizeof(vclip)); + memcpy(*ppvc, &vclip, sizeof(vclip)); (*ppvc)->next = NULL; return (0); } @@ -2719,13 +2719,15 @@ static int linux_v4l_cliplist_free(struct video_window *vw) { - struct video_clip **ppvc; - struct video_clip **ppvc_next; + struct video_clip *ppvc; + struct video_clip *ppvc_next; - for (ppvc = &(vw->clips); *ppvc != NULL; ppvc = ppvc_next) { - ppvc_next = &((*ppvc)->next); - free(*ppvc, M_LINUX); + for (ppvc = vw->clips; ppvc != NULL; ppvc = ppvc_next) { + ppvc_next = ppvc->next; + free(ppvc, M_LINUX); } + vw->clips = NULL; + return (0); }