From owner-freebsd-emulation@FreeBSD.ORG Wed Feb 17 20:38:57 2010 Return-Path: Delivered-To: emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E269A1065670; Wed, 17 Feb 2010 20:38:57 +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 B93428FC08; Wed, 17 Feb 2010 20:38:56 +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=QNvqGkBH2OBjHunDvtkA:7 a=KOhH291llilY6yQ8apL35LyFWmcA: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 1353935862; Wed, 17 Feb 2010 21:38:54 +0100 From: Hans Petter Selasky To: freebsd-multimedia@freebsd.org, lme@freebsd.org Date: Wed, 17 Feb 2010 21:37:25 +0100 User-Agent: KMail/1.12.4 (FreeBSD/8.0-STABLE; KDE/4.3.4; amd64; ; ) References: <20091204223126.00005392@unknown> <20100112124621.59fa3747@shibato.opal.com> <201001121849.48833.hselasky@c2i.net> In-Reply-To: <201001121849.48833.hselasky@c2i.net> X-Face: +~\`s("[*|O,="7?X@L.elg*F"OA\I/3%^p8g?ab%RN'(; _IjlA: hGE..Ew, XAQ*o#\/M~SC=S1-f9{EzRfT'|Hhll5Q]ha5Bt-s|oTlKMusi:1e[wJl}kd}GR Z0adGx-x_0zGbZj'e(Y[(UNle~)8CQWXW@:DX+9)_YlB[tIccCPN$7/L' MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201002172137.25396.hselasky@c2i.net> Cc: emulation@freebsd.org, Alexander Leidinger , multimedia@freebsd.org Subject: Re: FYI: v4l-linuxulator support in FreeBSD-current now [panic] X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Feb 2010 20:38:58 -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 not enough. Help appreciated. We are currently debugging this issue @ #bsdusb on efnet. --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); }